syzbot


KASAN: use-after-free Read in nbd_release

Status: upstream: reported C repro on 2021/02/20 11:32
Reported-by: syzbot+bf068cf224727e479bfa@syzkaller.appspotmail.com
First crash: 1217d, last: 475d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in nbd_release nbd C inconclusive unreliable 5 1042d 1216d 0/27 auto-obsoleted due to no activity on 2022/09/15 06:29
linux-4.19 KASAN: use-after-free Read in nbd_release C error 99 479d 1217d 0/1 upstream: reported C repro on 2021/02/21 06:21
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2021/11/15 16:05 21m bisect fix linux-4.14.y job log (0) log
2021/10/16 15:39 26m bisect fix linux-4.14.y job log (0) log
2021/09/16 13:57 25m bisect fix linux-4.14.y job log (0) log
2021/08/17 13:12 22m bisect fix linux-4.14.y job log (0) log
2021/07/18 08:23 22m bisect fix linux-4.14.y job log (0) log
2021/06/18 07:57 21m bisect fix linux-4.14.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:185 [inline]
BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline]
BUG: KASAN: use-after-free in refcount_dec_not_one+0x9a/0xc0 lib/refcount.c:270
Read of size 4 at addr ffff88809ae4e3d8 by task systemd-udevd/10816

CPU: 1 PID: 10816 Comm: systemd-udevd Not tainted 4.14.299-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
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_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 __read_once_size include/linux/compiler.h:185 [inline]
 atomic_read arch/x86/include/asm/atomic.h:27 [inline]
 refcount_dec_not_one+0x9a/0xc0 lib/refcount.c:270
 refcount_dec_and_mutex_lock+0x1a/0x60 lib/refcount.c:309
 nbd_put drivers/block/nbd.c:228 [inline]
 nbd_release+0xf3/0x150 drivers/block/nbd.c:1454
 __blkdev_put+0x5aa/0x800 fs/block_dev.c:1803
 blkdev_close+0x86/0xb0 fs/block_dev.c:1875
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 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+0x5e/0xd3

Allocated by task 10813:
 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
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 nbd_dev_add+0x7c/0x800 drivers/block/nbd.c:1619
 nbd_genl_connect+0x3a4/0x13e0 drivers/block/nbd.c:1764
 genl_family_rcv_msg+0x572/0xb20 net/netlink/genetlink.c:600
 genl_rcv_msg+0xaf/0x140 net/netlink/genetlink.c:625
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:636
 netlink_unicast_kernel net/netlink/af_netlink.c:1296 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1322
 netlink_sendmsg+0x648/0xbc0 net/netlink/af_netlink.c:1893
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Freed by task 10816:
 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
 nbd_dev_remove drivers/block/nbd.c:223 [inline]
 nbd_put.part.0+0x100/0x140 drivers/block/nbd.c:231
 nbd_put drivers/block/nbd.c:267 [inline]
 nbd_config_put+0x51c/0x6c0 drivers/block/nbd.c:1172
 nbd_release+0xdf/0x150 drivers/block/nbd.c:1453
 __blkdev_put+0x5aa/0x800 fs/block_dev.c:1803
 blkdev_close+0x86/0xb0 fs/block_dev.c:1875
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 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+0x5e/0xd3

The buggy address belongs to the object at ffff88809ae4e300
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 216 bytes inside of
 512-byte region [ffff88809ae4e300, ffff88809ae4e500)
The buggy address belongs to the page:
page:ffffea00026b9380 count:1 mapcount:0 mapping:ffff88809ae4e080 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff88809ae4e080 0000000000000000 0000000100000006
raw: ffffea000270bb20 ffffea00026d7520 ffff88813fe74940 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809ae4e280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88809ae4e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809ae4e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff88809ae4e400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809ae4e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (125):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/16 23:17 linux-4.14.y e911713e40ca 3a127a31 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/06/08 15:51 linux-4.14.y b8f3be299d51 b2706118 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2021/05/08 08:33 linux-4.14.y 7d7d1c0ab3eb bc5434be .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2021/04/17 07:16 linux-4.14.y cf256fbcbe34 7e2b734b .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/03/05 06:52 linux-4.14.y 7878a41b6cc1 f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/03/04 12:38 linux-4.14.y 7878a41b6cc1 f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/03/03 18:14 linux-4.14.y 7878a41b6cc1 f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/02/28 22:52 linux-4.14.y 7878a41b6cc1 95aee97a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/02/15 23:09 linux-4.14.y a8ad60f2af58 6be0f1f5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/02/11 09:48 linux-4.14.y a8ad60f2af58 93e26d60 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/01/17 11:15 linux-4.14.y c4215ee4771b a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/01/14 12:51 linux-4.14.y c4215ee4771b a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/01/11 11:17 linux-4.14.y c4215ee4771b 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/01/04 22:49 linux-4.14.y c4215ee4771b 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/01/01 17:03 linux-4.14.y c4215ee4771b ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2023/01/01 09:21 linux-4.14.y c4215ee4771b ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/12/31 18:34 linux-4.14.y c4215ee4771b ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/12/31 14:20 linux-4.14.y c4215ee4771b ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/12/29 00:58 linux-4.14.y c4215ee4771b 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/12/28 18:03 linux-4.14.y c4215ee4771b 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/11/20 21:35 linux-4.14.y e911713e40ca 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/11/20 18:49 linux-4.14.y e911713e40ca 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/11/19 18:29 linux-4.14.y e911713e40ca 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/11/16 22:59 linux-4.14.y e911713e40ca 3a127a31 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/11/06 10:50 linux-4.14.y a901bb6c7db7 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/10/28 02:14 linux-4.14.y 41f36d7859a7 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/10/26 23:55 linux-4.14.y 41f36d7859a7 86777b7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/10/18 12:17 linux-4.14.y 9d5c0b3a8e1a b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/10/15 19:27 linux-4.14.y 9d5c0b3a8e1a 67cb024c .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/26 00:16 linux-4.14.y 4edbf74132a4 0042f2b4 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/24 12:11 linux-4.14.y 4edbf74132a4 0042f2b4 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/18 09:17 linux-4.14.y 5df8b4735177 dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/14 08:35 linux-4.14.y 65640c873dcf b884348d .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/09 00:27 linux-4.14.y 65640c873dcf f3027468 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/08 19:24 linux-4.14.y 65640c873dcf f3027468 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/07 21:58 linux-4.14.y 65640c873dcf c5b7bc57 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/06 21:53 linux-4.14.y 65640c873dcf 65aea2b9 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/06 04:51 linux-4.14.y 65640c873dcf 9dcd38fc .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/09/02 13:56 linux-4.14.y e548869f356f a805568e .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/08/15 00:20 linux-4.14.y b641242202ed 8dfcaa3d .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/08/06 13:16 linux-4.14.y b641242202ed 88e3a122 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/08/04 00:52 linux-4.14.y b641242202ed 1c9013ac .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/08/03 19:38 linux-4.14.y b641242202ed 1c9013ac .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/08/03 12:41 linux-4.14.y b641242202ed 1c9013ac .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/08/01 00:40 linux-4.14.y b641242202ed fef302b1 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/07/23 20:10 linux-4.14.y 9c3bf9cf362f 22343af4 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/07/22 13:13 linux-4.14.y 9c3bf9cf362f 22343af4 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/07/22 10:29 linux-4.14.y 9c3bf9cf362f 5e6028b9 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/07/07 00:22 linux-4.14.y ed2e96e11936 bff65f44 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2022/07/05 22:19 linux-4.14.y ed2e96e11936 bff65f44 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
2021/02/20 11:31 linux-4.14.y 29c52025152b 3e5ed8b4 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in nbd_release
* Struck through repros no longer work on HEAD.