zram-fix-out-of-bounds-access-in-read_block_state.patch removed from -mm tree
The quilt patch titled
Subject: zram: fix out-of-bounds access in read_block_state()
has been removed from the -mm tree. Its filename was
zram-fix-out-of-bounds-access-in-read_block_state.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Longlong Xia <[email protected]>
Subject: zram: fix out-of-bounds access in read_block_state()
Date: Tue, 4 Aug 2026 14:59:19 +0800
read_block_state() calculates nr_pages before taking dev_lock. If the device is reset and reinitialized with a smaller disksize before lock acquisition, nr_pages still describes the old table. The subsequent loop can then call slot_lock() past the end of the newly allocated table.
Read disksize after acquiring dev_lock and checking that the device is initialized. The read lock then keeps the table and its bound stable for the duration of the scan.
---
drivers/block/zram/zram_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/block/zram/zram_drv.c renamed from drivers/block/zram/zram_drv.c~zram-fix-out-of-bounds-access-in-read_block_state +3 -1
@@ -1543,7 +1543,7 @@ static ssize_t read_block_state(struct fchar *kbuf;ssize_t index, written =0 ;struct zram *zram = file->private_data; -unsigned long nr_pages = zram->disksize >>PAGE_SHIFT ; +unsigned long nr_pages; kbuf =kvmalloc (count,GFP_KERNEL );if (!kbuf)
@@ -1555,6 +1555,8 @@ static ssize_t read_block_state(struct freturn -EINVAL ; } + nr_pages = zram->disksize >>PAGE_SHIFT ; +for (index = *ppos; index < nr_pages; index++) {int copied;
_
Patches currently in -mm which might be from [email protected] are
mm-hugetlb-keep-max_huge_pages-when-dissolving-surplus-folios.patch