syzbot


KASAN: use-after-free Read in bcm_tx_start_timer

Status: auto-obsoleted due to no activity on 2023/04/13 11:08
Reported-by: syzbot+007967454df553e191c6@syzkaller.appspotmail.com
First crash: 509d, last: 509d

Sample crash report:
IPVS: sync thread started: state = BACKUP, mcast_ifn = veth1_to_batadv, syncid = 1, id = 0
==================================================================
BUG: KASAN: use-after-free in bcm_tx_start_timer+0x1a6/0x1b0 net/can/bcm.c:385
Read of size 8 at addr ffff8880148cb330 by task ksoftirqd/1/18

CPU: 1 PID: 18 Comm: ksoftirqd/1 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 bcm_tx_start_timer+0x1a6/0x1b0 net/can/bcm.c:385
 bcm_tx_timeout_tsklet+0x13c/0x3a0 net/can/bcm.c:416
 tasklet_action_common.constprop.0+0x265/0x360 kernel/softirq.c:522
 __do_softirq+0x265/0x980 kernel/softirq.c:292
 run_ksoftirqd+0x57/0x110 kernel/softirq.c:653
 smpboot_thread_fn+0x655/0x9e0 kernel/smpboot.c:164
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Allocated by task 19184:
 kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 bcm_tx_setup net/can/bcm.c:947 [inline]
 bcm_sendmsg+0x25d7/0x4150 net/can/bcm.c:1386
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 19152:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 bcm_release+0x260/0x950 net/can/bcm.c:1561
 __sock_release+0xcd/0x2a0 net/socket.c:599
 sock_close+0x15/0x20 net/socket.c:1214
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbf3/0x2be0 kernel/exit.c:870
 do_group_exit+0x125/0x310 kernel/exit.c:967
 get_signal+0x3f2/0x1f70 kernel/signal.c:2589
 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799
 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880148cb200
 which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 304 bytes inside of
 1024-byte region [ffff8880148cb200, ffff8880148cb600)
The buggy address belongs to the page:
page:ffffea0000523280 count:1 mapcount:0 mapping:ffff88813bff0ac0 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea000097fa88 ffff88813bff1848 ffff88813bff0ac0
raw: 0000000000000000 ffff8880148ca000 0000000100000007 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880148cb200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880148cb280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880148cb300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff8880148cb380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880148cb400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/14 11:07 linux-4.19.y 3f8a27f9e27b f6511626 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bcm_tx_start_timer
* Struck through repros no longer work on HEAD.