Skip to content

Commit 631ccd6

Browse files
author
Ming Lei
committed
zram: fix potential UAF of zram table
JIRA: https://issues.redhat.com/browse/RHEL-77219 CVE: CVE-2025-21671 commit 212fe1c Author: Kairui Song <kasong@tencent.com> Date: Tue Jan 7 14:54:46 2025 +0800 zram: fix potential UAF of zram table If zram_meta_alloc failed early, it frees allocated zram->table without setting it NULL. Which will potentially cause zram_meta_free to access the table if user reset an failed and uninitialized device. Link: https://lkml.kernel.org/r/20250107065446.86928-1-ryncsn@gmail.com Fixes: 74363ec ("zram: fix uninitialized ZRAM not releasing backing device") Signed-off-by: Kairui Song <kasong@tencent.com> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent 4dc17b6 commit 631ccd6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/block/zram/zram_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize)
13231323
zram->mem_pool = zs_create_pool(zram->disk->disk_name);
13241324
if (!zram->mem_pool) {
13251325
vfree(zram->table);
1326+
zram->table = NULL;
13261327
return false;
13271328
}
13281329

0 commit comments

Comments
 (0)