Skip to content

nullb: free zones when device is power-off - #1137

Open
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1145940=>linus-master
Open

nullb: free zones when device is power-off#1137
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1145940=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Aug 14, 2026

Copy link
Copy Markdown

Pull request for series with
subject: nullb: free zones when device is power-off
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1145940

@blktests-ci

blktests-ci Bot commented Aug 14, 2026

Copy link
Copy Markdown
Author

Upstream branch: 3aa1dca
series: https://patchwork.kernel.org/project/linux-block/list/?series=1145940
version: 1

@blktests-ci
blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from d89ab11 to fdba928 Compare August 16, 2026 18:34
@blktests-ci

blktests-ci Bot commented Aug 16, 2026

Copy link
Copy Markdown
Author

Upstream branch: fd923b3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1145940
version: 1

@blktests-ci
blktests-ci Bot force-pushed the series/1145940=>linus-master branch from 052a8e4 to eee90c8 Compare August 16, 2026 19:50
@blktests-ci
blktests-ci Bot force-pushed the linus-master_base branch from fdba928 to 60442a3 Compare August 17, 2026 14:10
@blktests-ci

blktests-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
Author

Upstream branch: 8d3ae59
series: https://patchwork.kernel.org/project/linux-block/list/?series=1145940
version: 1

@blktests-ci
blktests-ci Bot force-pushed the series/1145940=>linus-master branch from eee90c8 to f651ef8 Compare August 17, 2026 16:37
@blktests-ci
blktests-ci Bot force-pushed the linus-master_base branch from 60442a3 to 3df366e Compare August 19, 2026 05:25
A user powers off the device by writing 0 to `./config/nullb/nullb1/power`
via the nullb configfs interface, and later powers it on by writing 1
to the same file.

When the power-off command is executed, the zones created by the previous
task are not freed before new zones are created upon powering on again;
this results in the memory leak described in [1].

Add an operation to free zones within nullb_device_power_store().

[1]
BUG: memory leak
unreferenced object 0xffff888126990000 (size 56000):
  backtrace (crc 5c9573f8):
    null_init_zoned_dev+0x108/0x520 drivers/block/null_blk/zoned.c:94
    null_add_dev+0x8a6/0xae0 drivers/block/null_blk/main.c:1993
    nullb_device_power_store+0xf9/0x1f0 drivers/block/null_blk/main.c:501
    flush_write_buffer fs/configfs/file.c:207 [inline]
    configfs_write_iter+0x10d/0x1a0 fs/configfs/file.c:229
    new_sync_write fs/read_write.c:595 [inline]
    vfs_write+0x3ac/0x720 fs/read_write.c:687

Fixes: cedcafa ("nullb: add interface to power on disk")
Reported-by: syzbot+f57d67a92532a98a562d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f57d67a92532a98a562d
Tested-by: syzbot+f57d67a92532a98a562d@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
@blktests-ci

blktests-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Author

Upstream branch: bd5f485
series: https://patchwork.kernel.org/project/linux-block/list/?series=1145940
version: 1

@blktests-ci
blktests-ci Bot force-pushed the series/1145940=>linus-master branch from f651ef8 to dadbef1 Compare August 19, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant