syzbot


KASAN: use-after-free Read in nfc_llcp_sock_unlink

Status: auto-obsoleted due to no activity on 2022/09/14 15:37
Reported-by: syzbot+8b7c5fc0cfb74afee8d1@syzkaller.appspotmail.com
First crash: 551d, last: 508d

Cause bisection: introduced by (bisect log) :
commit 997acaf6b4b59c6a9c259740312a69ea549cc684
Author: Mark Rutland <mark.rutland@arm.com>
Date: Mon Jan 11 15:37:07 2021 +0000

  lockdep: report broken irq restoration

Crash: WARNING in kvm_wait (log)
Repro: C syz .config

Fix bisection: fixed by (bisect log) :
commit f567d6ef8606fb427636e824c867229ecb5aefab
Author: Maxim Mikityanskiy <maxtram95@gmail.com>
Date: Sun Feb 7 14:47:40 2021 +0000

  HID: plantronics: Workaround for double volume key presses

similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in nfc_llcp_sock_unlink C 13 18d 528d 0/1 upstream: reported C repro on 2021/04/17 16:59
linux-4.19 KASAN: use-after-free Read in nfc_llcp_sock_unlink C done 22 494d 532d 1/1 fixed on 2021/06/23 17:43
Patch testing requests:
Created Duration User Patch Repo Result
2022/09/14 13:27 18m net-next OK log
2022/09/14 10:27 18m net-next OK log
2022/09/14 06:27 18m net-next OK log
2022/09/14 03:27 18m net-next OK log
2022/09/14 00:27 18m net-next OK log
2022/09/13 18:27 15m net OK log
2022/09/13 14:27 16m net OK log
2022/09/13 11:27 18m net OK log
2022/09/13 07:27 19m net OK log
2022/09/13 03:27 18m net OK log
2022/09/12 23:27 18m net OK log
2021/04/03 01:08 10m tseewald@gmail.com patch git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git master report log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x3e6f/0x54c0 kernel/locking/lockdep.c:4771
Read of size 8 at addr ffff888144790468 by task syz-executor259/8387

CPU: 0 PID: 8387 Comm: syz-executor259 Not tainted 5.12.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232
 __kasan_report mm/kasan/report.c:399 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
 __lock_acquire+0x3e6f/0x54c0 kernel/locking/lockdep.c:4771
 lock_acquire kernel/locking/lockdep.c:5511 [inline]
 lock_acquire+0x1ab/0x740 kernel/locking/lockdep.c:5476
 __raw_write_lock include/linux/rwlock_api_smp.h:210 [inline]
 _raw_write_lock+0x2a/0x40 kernel/locking/spinlock.c:295
 nfc_llcp_sock_unlink+0x1d/0x1c0 net/nfc/llcp_core.c:32
 llcp_sock_release+0x286/0x580 net/nfc/llcp_sock.c:640
 __sock_release+0xcd/0x280 net/socket.c:599
 sock_close+0x18/0x20 net/socket.c:1258
 __fput+0x288/0x920 fs/file_table.c:280
 task_work_run+0xdd/0x1a0 kernel/task_work.c:140
 exit_task_work include/linux/task_work.h:30 [inline]
 do_exit+0xbfc/0x2a60 kernel/exit.c:825
 do_group_exit+0x125/0x310 kernel/exit.c:922
 get_signal+0x47f/0x2150 kernel/signal.c:2781
 arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789
 handle_signal_work kernel/entry/common.c:147 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x148/0x250 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43fd79
Code: Unable to access opcode bytes at RIP 0x43fd4f.
RSP: 002b:00007ffe40e4ce78 EFLAGS: 00000246
 ORIG_RAX: 000000000000012b
RAX: fffffffffffffe00 RBX: 00000000000f4240 RCX: 000000000043fd79
RDX: 0000000000000001 RSI: 00000000200032c0 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000403550
R13: 0000000000000000 R14: 00007ffe40e4cea0 R15: 00007ffe40e4ce90

Allocated by task 1:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:427 [inline]
 ____kasan_kmalloc mm/kasan/common.c:506 [inline]
 ____kasan_kmalloc mm/kasan/common.c:465 [inline]
 __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515
 kmalloc include/linux/slab.h:554 [inline]
 kzalloc include/linux/slab.h:684 [inline]
 nfc_llcp_register_device+0x45/0x9d0 net/nfc/llcp_core.c:1572
 nfc_register_device+0x6d/0x360 net/nfc/core.c:1124
 nfcsim_device_new+0x345/0x5c1 drivers/nfc/nfcsim.c:408
 nfcsim_init+0x71/0x14d drivers/nfc/nfcsim.c:455
 do_one_initcall+0x103/0x650 init/main.c:1226
 do_initcall_level init/main.c:1299 [inline]
 do_initcalls init/main.c:1315 [inline]
 do_basic_setup init/main.c:1335 [inline]
 kernel_init_freeable+0x63e/0x6c2 init/main.c:1537
 kernel_init+0xd/0x1b8 init/main.c:1424
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

Freed by task 8385:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357
 ____kasan_slab_free mm/kasan/common.c:360 [inline]
 ____kasan_slab_free mm/kasan/common.c:325 [inline]
 __kasan_slab_free+0xf5/0x130 mm/kasan/common.c:367
 kasan_slab_free include/linux/kasan.h:199 [inline]
 slab_free_hook mm/slub.c:1562 [inline]
 slab_free_freelist_hook+0x92/0x210 mm/slub.c:1600
 slab_free mm/slub.c:3161 [inline]
 kfree+0xe5/0x7f0 mm/slub.c:4213
 local_release net/nfc/llcp_core.c:175 [inline]
 kref_put include/linux/kref.h:65 [inline]
 nfc_llcp_local_put net/nfc/llcp_core.c:183 [inline]
 nfc_llcp_local_put+0x194/0x200 net/nfc/llcp_core.c:178
 llcp_sock_destruct+0x81/0x150 net/nfc/llcp_sock.c:950
 __sk_destruct+0x4b/0x900 net/core/sock.c:1795
 sk_destruct+0xbd/0xe0 net/core/sock.c:1839
 __sk_free+0xef/0x3d0 net/core/sock.c:1850
 sk_free+0x78/0xa0 net/core/sock.c:1861
 sock_put include/net/sock.h:1807 [inline]
 llcp_sock_release+0x3c9/0x580 net/nfc/llcp_sock.c:644
 __sock_release+0xcd/0x280 net/socket.c:599
 sock_close+0x18/0x20 net/socket.c:1258
 __fput+0x288/0x920 fs/file_table.c:280
 task_work_run+0xdd/0x1a0 kernel/task_work.c:140
 exit_task_work include/linux/task_work.h:30 [inline]
 do_exit+0xbfc/0x2a60 kernel/exit.c:825
 do_group_exit+0x125/0x310 kernel/exit.c:922
 get_signal+0x47f/0x2150 kernel/signal.c:2781
 arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789
 handle_signal_work kernel/entry/common.c:147 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x148/0x250 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x44/0xae

The buggy address belongs to the object at ffff888144790000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1128 bytes inside of
 2048-byte region [ffff888144790000, ffff888144790800)
The buggy address belongs to the page:
page:ffffea000511e400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x144790
head:ffffea000511e400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x57ff00000010200(slab|head)
raw: 057ff00000010200 dead000000000100 dead000000000122 ffff888010442000
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888144790300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888144790380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888144790400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                          ^
 ffff888144790480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888144790500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (68):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-net-this-kasan-gce 2021/05/03 21:05 net bbd6f0a94813 ad61f371 .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/21 13:00 net d83b8aa5207d 95777977 .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/15 04:30 net 00423969d806 fcdb12ba .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/14 15:14 net 2afeec08ab5c 3134b37f .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/03/26 09:47 net 75887e881b19 6a383ecf .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/05/07 12:14 net-next 95aafe911db6 f6da8120 .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/05/03 21:02 net-next 95aafe911db6 ad61f371 .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/24 19:27 net-next b2f0ca00e6b3 17f0b706 .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/15 04:43 net-next 652d3be21dc8 fcdb12ba .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/14 13:32 net-next 5871d0c6b8ea 3134b37f .config log report syz C KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/05/07 12:36 net bbd6f0a94813 f6da8120 .config log report syz KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-root 2021/05/07 11:50 upstream d2b6f8a17919 f6da8120 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/05/07 10:36 upstream d2b6f8a17919 f6da8120 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/04/29 10:03 upstream d72cd4ad4174 77e2b668 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/04/28 15:32 upstream acd3d2859453 77e2b668 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-root 2021/04/27 18:11 upstream 57fa2369ab17 805b5003 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-smack-root 2021/04/27 07:37 upstream 4a0225c3d208 805b5003 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-root 2021/04/27 04:43 upstream 4a0225c3d208 805b5003 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-smack-root 2021/04/26 16:56 upstream 9f4ad9e425a1 805b5003 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/22 04:10 upstream 16fc44d6387e 2bc8999a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/21 19:54 upstream 16fc44d6387e 95777977 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/21 04:51 upstream 1fe5501ba1ab c0ced557 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/04/20 13:22 upstream 7af08140979a c0ced557 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/20 02:52 upstream 7af08140979a 4285c989 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-root 2021/04/20 01:16 upstream 7af08140979a 4285c989 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-smack-root 2021/04/19 23:34 upstream 7af08140979a 4285c989 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/04/19 10:02 upstream bf05bf16c76b 50f523d7 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/19 03:28 upstream bf05bf16c76b 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-root 2021/04/17 20:48 upstream 194cf4825638 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/16 21:33 upstream 2f7b98d1e55c 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/16 00:02 upstream 7e25f40eab52 c59079a6 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/04/14 22:35 upstream 7f75285ca572 fcdb12ba .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/04/14 15:58 upstream 50987beca096 3134b37f .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/14 13:27 upstream 50987beca096 3134b37f .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-selinux-root 2021/04/14 12:06 upstream 50987beca096 3134b37f .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/14 00:48 upstream eebe426d32e1 a184b83e .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream 2021/04/13 11:39 upstream 89698becf06d bfeda1b1 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-smack-root 2021/04/12 14:35 upstream d434405aaab7 bfeda1b1 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-kasan-gce-smack-root 2021/04/12 13:57 upstream d434405aaab7 bfeda1b1 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/05/07 20:15 upstream 18a3c5f7abfd f6da8120 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/22 06:41 upstream 16fc44d6387e 2bc8999a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/20 08:46 upstream 7af08140979a c0ced557 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/19 23:41 upstream 7af08140979a 4285c989 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/19 02:21 upstream 5ffe04ccd69a 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/17 07:25 upstream 9cdbf6467424 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/16 16:44 upstream 2f7b98d1e55c 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/16 13:33 upstream 7e25f40eab52 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/14 14:24 upstream 50987beca096 3134b37f .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/14 13:50 upstream 50987beca096 3134b37f .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-qemu-upstream-386 2021/04/14 10:26 upstream 50987beca096 3134b37f .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/18 12:10 net 88a5af943985 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/09 20:55 net 27f0ad71699d 6a81331a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/08 03:43 net 5219d6012d46 6a81331a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/04 18:18 net a14d273ba159 6a81331a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/03 12:55 net 990b03b05b2f 6a81331a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/04/01 11:05 net d47ec7a0a727 6a81331a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/03/26 08:03 net 75887e881b19 6a383ecf .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-this-kasan-gce 2021/03/26 07:34 net 75887e881b19 6a383ecf .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/27 06:01 net-next 95aafe911db6 805b5003 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/24 01:49 net-next b2f0ca00e6b3 17f0b706 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/19 22:28 net-next e7ad33fa7bc5 4285c989 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/19 02:17 net-next e7ad33fa7bc5 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-net-kasan-gce 2021/04/18 20:38 net-next e7ad33fa7bc5 7e2b734b .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-linux-next-kasan-gce-root 2021/04/19 12:41 linux-next 1216f02e46a4 50f523d7 .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-linux-next-kasan-gce-root 2021/04/09 18:15 linux-next e99d8a849517 6a81331a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
ci-upstream-linux-next-kasan-gce-root 2021/04/04 18:10 linux-next 454c576c3f5e 6a81331a .config log report info KASAN: use-after-free Read in nfc_llcp_sock_unlink
* Struck through repros no longer work on HEAD.