Linux block layer
 help / color / mirror / Atom feed
* [PATCH V3 0/6] null_blk: fix init/exit races and memleaks
@ 2026-07-08  7:39 Zizhi Wo
  2026-07-08  7:39 ` [PATCH V3 1/6] null_blk: use DEFINE_MUTEX for the file-scope mutex Zizhi Wo
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Zizhi Wo @ 2026-07-08  7:39 UTC (permalink / raw)
  To: axboe, dlemoal, nilay, kch, johannes.thumshirn, kbusch,
	bvanassche, linux-block
  Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi

This series fixes several issues in null_blk around lock initialization,
concurrent configfs access, and module init/exit.

Patch 1 fixes the uninitialized mutex. Following Bart's suggestion, the
fix now uses DEFINE_MUTEX(). This series no longer renames the lock;
following Damien Le Moal's suggestion, the rename and locking rework will
be sent as a separate series.

Patch 2 fixes configfs registration concurrency.

Patch 3 reorders resource release in null_exit() to match null_init().

Patch 4 fixes a global tag_set leak on the null_init() error path.

Patch 5 fixes a mid-setup race where a store changes a field before
CONFIGURED is set, causing out-of-bounds dev->zones[] access

Patch 6 adds READ_ONCE()/WRITE_ONCE() to the configfs attribute
reads/writes that race with each other.

Changes since v2:
- Dropped the lock rename patch; the rename and locking rework will be
  sent as a separate series (per Damien's suggestion).
- Patch 3: fixed the tense in the commit message.
- Patch 5: Mofify the lock position in v2 patch 4 to fix a mid-setup race.
- Added new patch 6.
https://lore.kernel.org/all/20260707025542.1299859-1-wozizhi@huaweicloud.com/

Changes since v1:
- Added patches 4-6, and modify the lock name in patch 2.
https://lore.kernel.org/all/20260706123507.3809871-1-wozizhi@huaweicloud.com/

Zizhi Wo (6):
  null_blk: use DEFINE_MUTEX for the file-scope mutex
  null_blk: register configfs subsystem after creating default devices
  null_blk: move unregister_blkdev() after destroying dev in null_exit()
  null_blk: free global tag_set on init error path
  null_blk: serialize configfs attribute stores with device setup
  null_blk: mark racy configfs attribute accesses with
    READ_ONCE/WRITE_ONCE

 drivers/block/null_blk/main.c  | 92 +++++++++++++++-------------------
 drivers/block/null_blk/zoned.c | 18 +++----
 2 files changed, 49 insertions(+), 61 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-07-09  2:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  7:39 [PATCH V3 0/6] null_blk: fix init/exit races and memleaks Zizhi Wo
2026-07-08  7:39 ` [PATCH V3 1/6] null_blk: use DEFINE_MUTEX for the file-scope mutex Zizhi Wo
2026-07-08  7:39 ` [PATCH V3 2/6] null_blk: register configfs subsystem after creating default devices Zizhi Wo
2026-07-08 15:51   ` Bart Van Assche
2026-07-08  7:39 ` [PATCH V3 3/6] null_blk: move unregister_blkdev() after destroying dev in null_exit() Zizhi Wo
2026-07-08 15:51   ` Bart Van Assche
2026-07-08  7:39 ` [PATCH V3 4/6] null_blk: free global tag_set on init error path Zizhi Wo
2026-07-08 15:56   ` Bart Van Assche
2026-07-08  7:39 ` [PATCH V3 5/6] null_blk: serialize configfs attribute stores with device setup Zizhi Wo
2026-07-08  9:11   ` Zizhi Wo
2026-07-08  7:39 ` [PATCH V3 6/6] null_blk: mark racy configfs attribute accesses with READ_ONCE/WRITE_ONCE Zizhi Wo
2026-07-08 17:49   ` Nilay Shroff
2026-07-09  2:17     ` Zizhi Wo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox