Hao Zhang
8fe9ed44dc
mm/page_alloc: fix uninitialized variable
The variable "compact_result" is not initialized in function
__alloc_pages_slowpath(). It causes should_compact_retry() to use an
uninitialized value.
Initialize variable "compact_result" with the value COMPACT_SKIPPED.
BUG: KMSAN: uninit-value in __alloc_pages_slowpath+0xee8/0x16c0 mm/page_alloc.c:4416
__alloc_pages_slowpath+0xee8/0x16c0 mm/page_alloc.c:4416
__alloc_frozen_pages_noprof+0xa4c/0xe00 mm/page_alloc.c:4752
alloc_pages_mpol+0x4cd/0x890 mm/mempolicy.c:2270
alloc_frozen_pages_noprof mm/mempolicy.c:2341 [inline]
alloc_pages_noprof mm/mempolicy.c:2361 [inline]
folio_alloc_noprof+0x1dc/0x350 mm/mempolicy.c:2371
filemap_alloc_folio_noprof+0xa6/0x440 mm/filemap.c:1019
__filemap_get_folio+0xb9a/0x1840 mm/filemap.c:1970
grow_dev_folio fs/buffer.c:1039 [inline]
grow_buffers fs/buffer.c:1105 [inline]
__getblk_slow fs/buffer.c:1131 [inline]
bdev_getblk+0x2c9/0xab0 fs/buffer.c:1431
getblk_unmovable include/linux/buffer_head.h:369 [inline]
ext4_getblk+0x3b7/0xe50 fs/ext4/inode.c:864
ext4_bread_batch+0x9f/0x7d0 fs/ext4/inode.c:933
__ext4_find_entry+0x1ebb/0x36c0 fs/ext4/namei.c:1627
ext4_lookup_entry fs/ext4/namei.c:1729 [inline]
ext4_lookup+0x189/0xb40 fs/ext4/namei.c:1797
__lookup_slow+0x538/0x710 fs/namei.c:1793
lookup_slow+0x6a/0xd0 fs/namei.c:1810
walk_component fs/namei.c:2114 [inline]
link_path_walk+0xf29/0x1420 fs/namei.c:2479
path_openat+0x30f/0x6250 fs/namei.c:3985
do_filp_open+0x268/0x600 fs/namei.c:4016
do_sys_openat2+0x1bf/0x2f0 fs/open.c:1428
do_sys_open fs/open.c:1443 [inline]
__do_sys_openat fs/open.c:1459 [inline]
__se_sys_openat fs/open.c:1454 [inline]
__x64_sys_openat+0x2a1/0x310 fs/open.c:1454
x64_sys_call+0x36f5/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:258
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Local variable compact_result created at:
__alloc_pages_slowpath+0x66/0x16c0 mm/page_alloc.c:4218
__alloc_frozen_pages_noprof+0xa4c/0xe00 mm/page_alloc.c:4752
Link: https://lkml.kernel.org/r/tencent_ED1032321D6510B145CDBA8CBA0093178E09@qq.com
Reported-by: syzbot+0cfd5e38e96a5596f2b6@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=0cfd5e38e96a5596f2b6
Signed-off-by: Hao Zhang <zhanghao1@kylinos.cn>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-05 21:36:20 -08:00
..
2025-01-25 20:22:46 -08:00
2025-02-17 22:40:04 -08:00
2025-02-01 03:53:26 -08:00
2025-03-05 21:36:14 -08:00
2024-11-07 14:38:07 -08:00
2024-11-14 22:49:19 -08:00
2025-01-13 22:40:35 -08:00
2025-03-05 21:36:15 -08:00
2024-09-17 01:07:01 -07:00
2025-01-25 20:22:23 -08:00
2025-01-13 22:40:59 -08:00
2024-11-07 14:25:16 -08:00
2024-11-03 01:28:06 -05:00
2024-09-01 20:43:33 -07:00
2024-09-01 20:43:33 -07:00
2025-01-26 18:36:23 -08:00
2024-11-05 11:14:32 +01:00
2025-02-01 03:53:27 -08:00
2025-01-25 20:22:41 -08:00
2025-01-25 20:22:42 -08:00
2025-01-28 13:48:37 +01:00
2025-03-05 21:36:14 -08:00
2025-01-13 22:40:50 -08:00
2025-03-05 21:36:13 -08:00
2025-01-25 20:22:21 -08:00
2024-08-27 14:12:51 +02:00
2025-01-26 18:36:23 -08:00
2025-02-01 03:53:25 -08:00
2025-01-25 20:22:40 -08:00
2024-12-30 17:59:10 -08:00
2024-11-11 00:26:44 -08:00
2025-02-17 22:40:01 -08:00
2025-01-13 22:40:48 -08:00
2025-01-25 20:22:38 -08:00
2025-01-13 22:40:40 -08:00
2024-12-05 19:54:46 -08:00
2025-02-17 22:40:03 -08:00
2025-01-25 20:22:40 -08:00
2025-03-05 21:36:13 -08:00
2025-03-05 21:36:13 -08:00
2024-09-26 14:01:44 -07:00
2025-03-05 21:36:18 -08:00
2025-01-25 20:22:41 -08:00
2025-02-17 22:40:02 -08:00
2025-01-25 20:22:45 -08:00
2024-11-07 14:14:58 -08:00
2025-01-25 20:22:30 -08:00
2025-01-13 22:40:34 -08:00
2025-01-25 20:22:38 -08:00
2025-01-25 20:22:23 -08:00
2024-09-01 20:25:54 -07:00
2024-09-01 20:25:55 -07:00
2024-11-11 00:26:44 -08:00
2025-01-12 19:03:37 -08:00
2025-01-13 22:40:51 -08:00
2024-12-11 17:28:41 +01:00
2025-01-25 20:22:29 -08:00
2025-01-25 20:22:29 -08:00
2025-01-25 20:22:38 -08:00
2025-01-28 13:48:37 +01:00
2025-03-05 21:36:20 -08:00
2025-01-06 17:24:38 +01:00
2024-08-15 22:16:14 -07:00
2025-01-13 22:40:31 -08:00
2025-01-25 20:22:19 -08:00
2025-01-25 20:22:36 -08:00
2025-03-05 21:36:14 -08:00
2024-11-07 14:38:07 -08:00
2025-01-28 13:48:37 +01:00
2024-11-11 00:26:44 -08:00
2025-01-25 20:22:38 -08:00
2024-12-18 19:04:43 -08:00
2024-11-05 16:56:23 -08:00
2025-01-13 22:40:48 -08:00
2025-01-26 18:36:23 -08:00
2024-11-07 14:38:07 -08:00
2025-01-13 22:40:38 -08:00
2025-01-27 19:25:45 -05:00
2024-09-01 20:25:45 -07:00
2025-03-05 21:36:18 -08:00
2024-11-07 14:38:08 -08:00
2025-01-15 13:14:37 +01:00
2024-10-31 20:27:04 -07:00
2025-01-26 18:36:23 -08:00
2025-01-13 10:22:04 +01:00
2025-01-28 12:25:12 -08:00
2025-01-25 20:22:30 -08:00
2025-01-25 20:22:38 -08:00
2025-01-25 20:22:19 -08:00
2025-01-25 20:22:37 -08:00
2025-01-25 20:22:21 -08:00
2025-01-25 20:22:43 -08:00
2024-09-17 01:07:01 -07:00
2025-03-05 21:36:15 -08:00
2025-01-25 20:22:43 -08:00
2025-03-05 21:36:18 -08:00
2025-01-13 22:40:59 -08:00
2025-01-13 22:40:42 -08:00
2025-03-05 21:36:14 -08:00
2025-01-25 20:22:38 -08:00
2025-03-05 21:36:18 -08:00
2025-02-01 03:53:24 -08:00
2025-01-12 19:03:38 -08:00
2025-01-25 20:22:39 -08:00
2024-09-01 20:25:56 -07:00
2025-01-25 20:22:35 -08:00
2025-02-01 03:53:23 -08:00
2025-03-05 21:36:17 -08:00