syzbot


KASAN: use-after-free Read in nr_release

Status: upstream: reported C repro on 2019/08/13 12:20
Reported-by: syzbot+7e79fbe1b2d89a255fc2@syzkaller.appspotmail.com
First crash: 1775d, last: 477d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in nr_release C 327 476d 1779d 0/1 upstream: reported C repro on 2019/08/10 01:07
upstream KASAN: use-after-free Read in nr_release hams C done 25 1762d 1841d 12/27 fixed on 2019/08/27 17:15
upstream KASAN: use-after-free Read in nr_release (2) hams syz error error 59 1669d 1759d 0/27 auto-obsoleted due to no activity on 2023/04/12 23:03
upstream KASAN: use-after-free Write in nr_release hams C done error 1784 394d 1667d 22/27 fixed on 2023/06/08 14:41
Fix bisection attempts (15)
Created Duration User Patch Repo Result
2023/03/03 13:19 2h17m bisect fix linux-4.14.y job log (0) log
2022/09/01 22:24 22m bisect fix linux-4.14.y job log (0) log
2022/04/28 01:56 37m bisect fix linux-4.14.y job log (0) log
2022/03/19 16:51 34m bisect fix linux-4.14.y job log (0) log
2022/01/27 17:00 39m bisect fix linux-4.14.y job log (0) log
2021/12/09 17:15 33m bisect fix linux-4.14.y job log (0) log
2021/11/09 16:45 28m bisect fix linux-4.14.y job log (0) log
2021/10/10 16:16 29m bisect fix linux-4.14.y job log (0) log
2021/09/10 15:38 37m bisect fix linux-4.14.y job log (0) log
2021/08/11 14:57 38m bisect fix linux-4.14.y job log (0) log
2021/07/12 14:18 29m bisect fix linux-4.14.y job log (0) log
2021/06/12 13:46 31m bisect fix linux-4.14.y job log (0) log
2021/04/26 05:59 44m bisect fix linux-4.14.y job log (0) log
2021/01/08 18:49 34m bisect fix linux-4.14.y job log (0) log
2020/11/12 21:28 36m bisect fix linux-4.14.y job log (0) log

Sample crash report:
Bluetooth: hci5 command 0x0419 tx timeout
Bluetooth: hci2 command 0x0419 tx timeout
Bluetooth: hci0 command 0x0419 tx timeout
Bluetooth: hci4 command 0x0419 tx timeout
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x2c57/0x3f20 kernel/locking/lockdep.c:3369
Read of size 8 at addr ffff88808fb808f8 by task syz-executor387/9423

CPU: 0 PID: 9423 Comm: syz-executor387 Not tainted 4.14.284-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 __lock_acquire+0x2c57/0x3f20 kernel/locking/lockdep.c:3369
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 __raw_write_lock_bh include/linux/rwlock_api_smp.h:203 [inline]
 _raw_write_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:320
 sock_orphan include/net/sock.h:1713 [inline]
 nr_release+0x5b/0x340 net/netrom/af_netrom.c:524
 __sock_release+0xcd/0x2b0 net/socket.c:602
 sock_close+0x15/0x20 net/socket.c:1139
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa44/0x2850 kernel/exit.c:868
 do_group_exit+0x100/0x2e0 kernel/exit.c:965
 get_signal+0x38d/0x1ca0 kernel/signal.c:2412
 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:792
 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7fdfc7ed89b9
RSP: 002b:00007fff91b1dd88 EFLAGS: 00000246 ORIG_RAX: 000000000000002b
RAX: fffffffffffffe00 RBX: 0000000000000003 RCX: 00007fdfc7ed89b9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004
RBP: 0000000000000003 R08: 0000000000000150 R09: 0000000000000150
R10: 0000000000000150 R11: 0000000000000246 R12: 00005555569b62b8
R13: 0000000000000011 R14: 00007fff91b1ddf0 R15: 00007fff91b1de30

Allocated by task 9423:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15a/0x400 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 sk_prot_alloc+0x1ba/0x290 net/core/sock.c:1484
 sk_alloc+0x36/0xcd0 net/core/sock.c:1538
 nr_create+0x99/0x5c0 net/netrom/af_netrom.c:436
 __sock_create+0x303/0x620 net/socket.c:1275
 sock_create net/socket.c:1315 [inline]
 SYSC_socket net/socket.c:1345 [inline]
 SyS_socket+0xd1/0x1b0 net/socket.c:1325
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 9423:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 sk_prot_free net/core/sock.c:1521 [inline]
 __sk_destruct+0x5e3/0x760 net/core/sock.c:1600
 sk_destruct net/core/sock.c:1615 [inline]
 __sk_free+0xd9/0x2d0 net/core/sock.c:1623
 sk_free+0x2b/0x40 net/core/sock.c:1634
 sock_put include/net/sock.h:1664 [inline]
 nr_release+0x2b7/0x340 net/netrom/af_netrom.c:557
 __sock_release+0xcd/0x2b0 net/socket.c:602
 sock_close+0x15/0x20 net/socket.c:1139
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa44/0x2850 kernel/exit.c:868
 do_group_exit+0x100/0x2e0 kernel/exit.c:965
 get_signal+0x38d/0x1ca0 kernel/signal.c:2412
 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:792
 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff88808fb80580
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 888 bytes inside of
 2048-byte region [ffff88808fb80580, ffff88808fb80d80)
The buggy address belongs to the page:
page:ffffea00023ee000 count:1 mapcount:0 mapping:ffff88808fb80580 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff88808fb80580 0000000000000000 0000000100000003
raw: ffffea00028beea0 ffffea00023ee0a0 ffff88813fe74c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808fb80780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808fb80800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88808fb80880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff88808fb80900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808fb80980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (117):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/06/17 12:11 linux-4.14.y 84bae26850e3 cb58b3b2 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/06/17 11:54 linux-4.14.y 84bae26850e3 cb58b3b2 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2019/10/05 07:43 linux-4.14.y f6e27dbb1afa f3f7d9c8 .config console log report syz ci2-linux-4-14
2019/09/18 14:42 linux-4.14.y 968722f5371a 1037b424 .config console log report syz ci2-linux-4-14
2023/02/01 11:13 linux-4.14.y 3949d1610004 9a6f477c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2023/01/23 16:54 linux-4.14.y 97205fccccdc 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2023/01/20 08:13 linux-4.14.y 97205fccccdc dd15ff29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/12/22 12:33 linux-4.14.y c4215ee4771b 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/12/19 21:41 linux-4.14.y c4215ee4771b c52b2efb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/12/15 12:33 linux-4.14.y c4215ee4771b 6f9c033e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/10/29 14:07 linux-4.14.y 41f36d7859a7 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/10/18 13:53 linux-4.14.y 9d5c0b3a8e1a b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/09/27 05:43 linux-4.14.y 4edbf74132a4 10323ddf .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/09/07 11:59 linux-4.14.y 65640c873dcf c5b7bc57 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/08/02 22:24 linux-4.14.y b641242202ed 1c9013ac .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/07/19 08:44 linux-4.14.y 424a46ea058e 72a3cc0c .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/07/07 16:02 linux-4.14.y 1048779a1d7d bff65f44 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/07/04 17:00 linux-4.14.y ed2e96e11936 bff65f44 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/06/29 16:31 linux-4.14.y f051383ef03b 1434eec0 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/06/22 20:36 linux-4.14.y 84bae26850e3 912f5df7 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/06/14 20:53 linux-4.14.y 1ccc597f801c 127d1faf .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/06/13 17:34 linux-4.14.y b8f3be299d51 0f087040 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/05/27 21:14 linux-4.14.y 501eec4f9e13 a46af346 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/05/21 04:33 linux-4.14.y dffb5c6ff09c 7268fa62 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/05/14 10:59 linux-4.14.y 569d1abf9402 744a39e2 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/05/10 23:33 linux-4.14.y e3a56aaade89 8d7b3b67 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/05/06 03:26 linux-4.14.y e3a56aaade89 efeff0a5 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/03/28 23:03 linux-4.14.y af1af6ebca0e 6bdac766 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2022/02/17 16:51 linux-4.14.y a35d65bedfbc 2bea8a27 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/12/28 17:00 linux-4.14.y 8ee0807eedf3 76c8cf06 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/12/21 12:06 linux-4.14.y 9dfbac0e6b86 a938f0b8 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/12/15 19:36 linux-4.14.y 9dfbac0e6b86 572bcb40 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/05/13 13:33 linux-4.14.y 7d7d1c0ab3eb ecb594cb .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/05/11 20:22 linux-4.14.y 7d7d1c0ab3eb b3c3bb8e .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/03/26 23:46 linux-4.14.y 670d6552eda8 a8529b82 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/03/25 15:21 linux-4.14.y 670d6552eda8 6a383ecf .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/03/03 04:36 linux-4.14.y 3242aa3a635c e5b64d68 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/02/12 06:00 linux-4.14.y 2c8a3fceddf0 a5f86b15 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2021/01/30 15:45 linux-4.14.y 2c8a3fceddf0 fc9fd31e .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nr_release
2020/12/09 18:49 linux-4.14.y 47cbf4cc32db 99917735 .config console log report info ci2-linux-4-14
2020/10/13 21:28 linux-4.14.y cbfa1702aaf6 fc7735a2 .config console log report info ci2-linux-4-14
2020/09/30 12:10 linux-4.14.y cbfa1702aaf6 8516f6d3 .config console log report info ci2-linux-4-14
2020/09/23 07:33 linux-4.14.y cbfa1702aaf6 287cd75a .config console log report info ci2-linux-4-14
2020/08/25 14:36 linux-4.14.y 6a24ca2506d6 344da168 .config console log report ci2-linux-4-14
2020/08/21 12:16 linux-4.14.y 6a24ca2506d6 1d75fe45 .config console log report ci2-linux-4-14
2020/08/16 18:15 linux-4.14.y 14b58326976d 5ce13532 .config console log report ci2-linux-4-14
2020/08/14 09:57 linux-4.14.y 14b58326976d 54ce1ed6 .config console log report ci2-linux-4-14
2020/08/11 18:26 linux-4.14.y 14b58326976d 5d3ebca9 .config console log report ci2-linux-4-14
2020/07/30 06:14 linux-4.14.y e5a54aa2d312 233283a1 .config console log report ci2-linux-4-14
2020/07/28 13:07 linux-4.14.y 69b94dd6dcd1 cb93dc6a .config console log report ci2-linux-4-14
2020/07/23 13:49 linux-4.14.y 69b94dd6dcd1 340ea530 .config console log report ci2-linux-4-14
2020/07/16 22:14 linux-4.14.y b850307b279c b090c643 .config console log report ci2-linux-4-14
2020/07/08 04:17 linux-4.14.y b850307b279c 08fc4ef1 .config console log report ci2-linux-4-14
2019/08/13 11:19 linux-4.14.y 3ffe1e79c174 8620c2c2 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.