[v5.15] KASAN: use-after-free Read in trylock_super (2)

0 views
Skip to first unread message

syzbot

unread,
Nov 9, 2026, 10:10:37 AM (6 days ago) Nov 9
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 29c6cdaac04a Linux 5.15.225
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11abe7a5580000
kernel config: https://syzkaller.appspot.com/x/.config?x=ac990d5ab58b7297
dashboard link: https://syzkaller.appspot.com/bug?extid=0b166f301028c27bdff7
compiler: Debian clang version 22.1.8 (1~deb13u4), 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/371eb90477e6/disk-29c6cdaa.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f4705bf118e0/vmlinux-29c6cdaa.xz
kernel image: https://storage.googleapis.com/syzbot-assets/426bc0a3580c/bzImage-29c6cdaa.xz

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

==================================================================
BUG: KASAN: use-after-free in __down_read_trylock kernel/locking/rwsem.c:1270 [inline]
BUG: KASAN: use-after-free in down_read_trylock+0xaf/0x3b0 kernel/locking/rwsem.c:1537
Read of size 8 at addr ffff8880749ec0d8 by task kworker/u4:0/12706

CPU: 0 PID: 12706 Comm: kworker/u4:0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Workqueue: writeback wb_workfn (flush-7:9)
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
__down_read_trylock kernel/locking/rwsem.c:1270 [inline]
down_read_trylock+0xaf/0x3b0 kernel/locking/rwsem.c:1537
trylock_super+0x1c/0xf0 fs/super.c:418
__writeback_inodes_wb+0x114/0x3f0 fs/fs-writeback.c:2002
wb_writeback+0x45e/0xbc0 fs/fs-writeback.c:2116
wb_check_background_flush fs/fs-writeback.c:2182 [inline]
wb_do_writeback fs/fs-writeback.c:2270 [inline]
wb_workfn+0xbd6/0xf20 fs/fs-writeback.c:2298
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
</TASK>

Allocated by task 14820:
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 include/linux/slab.h:607 [inline]
kzalloc include/linux/slab.h:738 [inline]
alloc_super+0x59/0x970 fs/super.c:203
sget+0x1ce/0x450 fs/super.c:637
nilfs_mount+0x452/0x8c0 fs/nilfs2/super.c:1331
legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1541
do_new_mount+0x247/0xa50 fs/namespace.c:3060
do_mount fs/namespace.c:3431 [inline]
__do_sys_mount fs/namespace.c:3639 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3616
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

Freed by task 4363:
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
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

Last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3d0 kernel/workqueue.c:1366
__queue_work+0x90b/0xc80 kernel/workqueue.c:1532
queue_work_on+0x124/0x1f0 kernel/workqueue.c:1559
rcu_do_batch kernel/rcu/tree.c:2523 [inline]
rcu_core+0x96e/0x1650 kernel/rcu/tree.c:2763
handle_softirqs+0x336/0x830 kernel/softirq.c:576
__do_softirq kernel/softirq.c:610 [inline]
invoke_softirq kernel/softirq.c:450 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:659
irq_exit_rcu+0x5/0x20 kernel/softirq.c:671
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676

Second to last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3011 [inline]
call_rcu+0x189/0x900 kernel/rcu/tree.c:3091
put_super fs/super.c:313 [inline]
deactivate_locked_super+0xc7/0xf0 fs/super.c:346
cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217
__syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff8880749ec000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 216 bytes inside of
4096-byte region [ffff8880749ec000, ffff8880749ed000)
The buggy address belongs to the page:
page:ffffea0001d27a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x749e8
head:ffffea0001d27a00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 0000000100000001 ffff888017842140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4194, ts 68592766799, free_ts 68560499978
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_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]
__kmalloc+0x11d/0x340 mm/slub.c:4408
kmalloc include/linux/slab.h:612 [inline]
tomoyo_realpath_from_path+0xed/0x5e0 security/tomoyo/realpath.c:254
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_number_perm+0x251/0x6b0 security/tomoyo/file.c:723
tomoyo_path_mkdir+0xad/0xf0 security/tomoyo/tomoyo.c:166
security_path_mkdir+0xe0/0x130 security/security.c:1205
do_mkdirat+0x15e/0x5c0 fs/namei.c:4136
__do_sys_mkdirat fs/namei.c:4156 [inline]
__se_sys_mkdirat fs/namei.c:4154 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4154
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
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
free_slab mm/slub.c:2020 [inline]
discard_slab mm/slub.c:2026 [inline]
__unfreeze_partials+0x188/0x1e0 mm/slub.c:2512
put_cpu_partial+0x12d/0x190 mm/slub.c:2592
qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
kmem_cache_alloc_node+0x184/0x2c0 mm/slub.c:3261
__alloc_skb+0xf4/0x750 net/core/skbuff.c:415
alloc_skb include/linux/skbuff.h:1162 [inline]
mld_newpack+0x12f/0xba0 net/ipv6/mcast.c:1773
add_grhead net/ipv6/mcast.c:1884 [inline]
add_grec+0x1364/0x1840 net/ipv6/mcast.c:2023
mld_send_cr net/ipv6/mcast.c:2146 [inline]
mld_ifc_work+0x6f2/0xd60 net/ipv6/mcast.c:2688
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334

Memory state around the buggy address:
ffff8880749ebf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880749ec000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880749ec080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880749ec100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880749ec180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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