[v5.15] KASAN: use-after-free Read in zswap_frontswap_load

0 views
Skip to first unread message

syzbot

unread,
Aug 3, 2026, 11:17:43 PMAug 3
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 6e2fd6534337 Linux 5.15.213
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13913e32580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f161cbc9aef65db0
dashboard link: https://syzkaller.appspot.com/bug?extid=4c7fb0055a3f3b44f130
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d7b46606b13d/disk-6e2fd653.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/da120fdeb081/vmlinux-6e2fd653.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3c2643457e3f/bzImage-6e2fd653.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4c7fb0...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: use-after-free in atomic_long_read include/linux/atomic/atomic-instrumented.h:1183 [inline]
BUG: KASAN: use-after-free in __mutex_unlock_slowpath+0xd5/0x6c0 kernel/locking/mutex.c:860
Read of size 8 at addr ffff88802bec8d00 by task syz.3.119/4696

CPU: 0 PID: 4696 Comm: syz.3.119 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x235/0x290 mm/kasan/generic.c:189
instrument_atomic_read include/linux/instrumented.h:71 [inline]
atomic_long_read include/linux/atomic/atomic-instrumented.h:1183 [inline]
__mutex_unlock_slowpath+0xd5/0x6c0 kernel/locking/mutex.c:860
zswap_frontswap_load+0x88d/0xcb0 mm/zswap.c:1306
__frontswap_load+0x25f/0x4e0 mm/frontswap.c:316
frontswap_load include/linux/frontswap.h:98 [inline]
swap_readpage+0xc8f/0xda0 mm/page_io.c:327
swap_cluster_readahead+0x37d/0x7c0 mm/swap_state.c:649
swapin_readahead+0xf1/0xab0 mm/swap_state.c:854
do_swap_page+0x4d0/0x1fd0 mm/memory.c:3622
handle_pte_fault mm/memory.c:4654 [inline]
__handle_mm_fault mm/memory.c:4785 [inline]
handle_mm_fault+0x1bd9/0x4440 mm/memory.c:4883
do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355
handle_page_fault arch/x86/mm/fault.c:1443 [inline]
exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
RIP: 0033:0x7fa96e96e7bf
Code: 1f 84 00 00 00 00 00 0f 1f 40 00 41 89 fb 44 8d 56 04 4c 8d 0d 52 08 3c 00 89 f0 4c 8d 05 49 e8 3b 00 89 c2 81 e2 ff 1f 00 00 <49> 8b 0c d1 48 39 f1 74 28 48 85 c9 74 29 45 38 1c 10 75 23 83 c0
RSP: 002b:00007fff2f2ecf68 EFLAGS: 00010202
RAX: 00000000817f242a RBX: ffffffff817f242a RCX: 0000000000000000
RDX: 000000000000042a RSI: ffffffff817f242a RDI: 0000000000000005
RBP: 0000000000000000 R08: 00007fa96ed2d000 R09: 00007fa96ed2f000
R10: 00000000817f242e R11: 0000000000000005 R12: 00007fa96ed43038
R13: 0000000000000008 R14: ffffffff817f22e6 R15: 00007fa96f872720
</TASK>

Allocated by task 1:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522
kmalloc_node include/linux/slab.h:625 [inline]
zswap_dstmem_prepare+0xa7/0x200 mm/zswap.c:417
cpuhp_invoke_callback+0x423/0x7e0 kernel/cpu.c:191
cpuhp_issue_call+0x3d3/0x760 kernel/cpu.c:-1
__cpuhp_setup_state_cpuslocked+0x410/0x7f0 kernel/cpu.c:2104
__cpuhp_setup_state+0x3b/0x50 kernel/cpu.c:2133
cpuhp_setup_state include/linux/cpuhotplug.h:282 [inline]
init_zswap+0x68/0x2d0 mm/zswap.c:1449
do_one_initcall+0x272/0x730 init/main.c:1315
do_initcall_level+0x13d/0x1f0 init/main.c:1388
do_initcalls+0x4b/0x90 init/main.c:1404
kernel_init_freeable+0x3d5/0x560 init/main.c:1628
kernel_init+0x19/0x1b0 init/main.c:1519
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Freed by task 4700:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
zswap_dstmem_dead+0x7e/0x200 mm/zswap.c:435
cpuhp_invoke_callback+0x423/0x7e0 kernel/cpu.c:191
__cpuhp_invoke_callback_range kernel/cpu.c:677 [inline]
cpuhp_invoke_callback_range kernel/cpu.c:701 [inline]
cpuhp_down_callbacks kernel/cpu.c:1130 [inline]
_cpu_down+0x455/0xbb0 kernel/cpu.c:1191
cpu_down_maps_locked kernel/cpu.c:1217 [inline]
cpu_down+0x4d/0x70 kernel/cpu.c:1225
target_store+0x316/0x4a0 kernel/cpu.c:2349
kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88802bec8d00
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 0 bytes inside of
192-byte region [ffff88802bec8d00, ffff88802bec8dc0)
The buggy address belongs to the page:
page:ffffea0000afb200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2bec8
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 0000000100000001 ffff888016c41a00
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 22257110576, free_ts 22166040564
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2031
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x807/0xdd0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc_trace+0xf9/0x290 mm/slub.c:3250
kmalloc include/linux/slab.h:607 [inline]
kzalloc include/linux/slab.h:738 [inline]
call_usermodehelper_setup+0x8a/0x260 kernel/umh.c:365
call_modprobe kernel/kmod.c:93 [inline]
__request_module+0x3ea/0x980 kernel/kmod.c:170
crypto_larval_lookup crypto/api.c:230 [inline]
crypto_alg_mod_lookup+0x96/0x6d0 crypto/api.c:277
crypto_find_alg crypto/api.c:490 [inline]
crypto_alloc_tfm_node+0x14e/0x360 crypto/api.c:527
crypto_alloc_tfm crypto/internal.h:101 [inline]
crypto_alloc_sync_skcipher+0x2f/0xc0 crypto/skcipher.c:768
rxkad_init+0x1e/0xe0 net/rxrpc/rxkad.c:1362
rxrpc_init_security+0x8c/0x180 net/rxrpc/security.c:31
af_rxrpc_init+0x14f/0x370 net/rxrpc/af_rxrpc.c:982
do_one_initcall+0x272/0x730 init/main.c:1315
do_initcall_level+0x13d/0x1f0 init/main.c:1388
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
__vunmap+0x8e0/0xa80 mm/vmalloc.c:2628
free_work+0x56/0x80 mm/vmalloc.c:95
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
ffff88802bec8c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802bec8c80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88802bec8d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88802bec8d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff88802bec8e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages