syzbot


KASAN: use-after-free Read in worker_thread

Status: closed as invalid on 2017/10/27 09:33
Reported-by: syzbot+3b758e0b6621be607e6c319cf9d4ae577c631abe@syzkaller.appspotmail.com
First crash: 2469d, last: 2467d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in worker_thread missing-backport origin:downstream C unreliable error 28 5d20h 609d 0/2 upstream: reported C repro on 2022/10/16 06:28
upstream KASAN: use-after-free Read in worker_thread (2) net syz 6 2402d 2411d 5/27 fixed on 2018/04/06 16:37
android-6-1 KASAN: use-after-free Read in worker_thread missing-backport origin:lts C error 28 3d22h 368d 0/2 upstream: reported C repro on 2023/06/14 05:51

Sample crash report:
sctp: [Deprecated]: syz-executor4 (pid 7375) Use of struct sctp_assoc_value in delayed_ack socket option.
Use struct sctp_sack_info instead
==================================================================
BUG: KASAN: use-after-free in worker_thread+0x147b/0x1860 kernel/workqueue.c:2251
Read of size 8 at addr ffff8801c16514f8 by task kworker/u4:10/3531

CPU: 1 PID: 3531 Comm: kworker/u4:10 Not tainted 4.13.0+ #43
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 print_address_description+0x73/0x250 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report+0x24e/0x340 mm/kasan/report.c:409
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 worker_thread+0x147b/0x1860 kernel/workqueue.c:2251
 kthread+0x39c/0x470 kernel/kthread.c:231
 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

Allocated by task 7363:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3561
 kmem_cache_zalloc include/linux/slab.h:656 [inline]
 kcm_attach net/kcm/kcmsock.c:1394 [inline]
 kcm_attach_ioctl net/kcm/kcmsock.c:1460 [inline]
 kcm_ioctl+0x2d1/0x1610 net/kcm/kcmsock.c:1695
 sock_do_ioctl+0x65/0xb0 net/socket.c:961
 sock_ioctl+0x2c2/0x440 net/socket.c:1058
 vfs_ioctl fs/ioctl.c:45 [inline]
 do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
 SYSC_ioctl fs/ioctl.c:700 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
 entry_SYSCALL_64_fastpath+0x1f/0xbe

Freed by task 3531:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x77/0x280 mm/slab.c:3763
 unreserve_psock+0x5a1/0x780 net/kcm/kcmsock.c:547
 kcm_write_msgs+0xbae/0x1b80 net/kcm/kcmsock.c:590
 kcm_tx_work+0x2e/0x190 net/kcm/kcmsock.c:731
 process_one_work+0xbfa/0x1bd0 kernel/workqueue.c:2119
 worker_thread+0x223/0x1860 kernel/workqueue.c:2253
 kthread+0x39c/0x470 kernel/kthread.c:231
 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

The buggy address belongs to the object at ffff8801c16513c0
 which belongs to the cache kcm_psock_cache of size 664
The buggy address is located 312 bytes inside of
 664-byte region [ffff8801c16513c0, ffff8801c1651658)
The buggy address belongs to the page:
page:ffffea0007059400 count:1 mapcount:0 mapping:ffff8801c1650040 index:0xffff8801c1650040 compound_mapcount: 0
flags: 0x200000000008100(slab|head)
raw: 0200000000008100 ffff8801c1650040 ffff8801c1650040 0000000100000003
raw: ffffea0007632ba0 ffff8801d2fcd240 ffff8801d2dc9500 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c1651380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8801c1651400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801c1651480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff8801c1651500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801c1651580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/09/14 08:42 net-next-old ad9a19d00370 96b8e399 .config console log report ci-upstream-net-kasan-gce
2017/09/11 23:10 net-next-old ad9a19d00370 96b8e399 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.