syzbot


KASAN: use-after-free Write in ex_handler_refcount (3)

Status: upstream: reported C repro on 2021/02/20 19:09
Reported-by: syzbot+503bc500eff20b70bf25@syzkaller.appspotmail.com
First crash: 1105d, last: 363d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Write in ex_handler_refcount (2) 1 1240d 1240d 0/1 auto-closed as invalid on 2021/02/06 10:12
linux-4.14 KASAN: use-after-free Write in ex_handler_refcount C done 16 1277d 1486d 1/1 fixed on 2020/10/03 03:40
android-54 KASAN: use-after-free Write in ex_handler_refcount syz 4 1279d 1281d 0/2 auto-obsoleted due to no activity on 2023/04/15 04:57
linux-4.19 KASAN: use-after-free Write in ex_handler_refcount (2) C error 44 363d 1069d 0/1 upstream: reported C repro on 2021/03/29 13:41
linux-4.19 KASAN: use-after-free Write in ex_handler_refcount C done 11 1277d 1486d 1/1 fixed on 2020/10/02 13:00
Fix bisection attempts (10)
Created Duration User Patch Repo Result
2022/10/13 02:26 0m bisect fix linux-4.14.y error job log (0)
2022/08/19 20:53 24m bisect fix linux-4.14.y job log (0) log
2022/04/05 14:20 20m bisect fix linux-4.14.y job log (0) log
2022/02/19 05:34 28m bisect fix linux-4.14.y job log (0) log
2021/11/24 00:37 25m bisect fix linux-4.14.y job log (0) log
2021/10/21 18:54 27m (2) bisect fix linux-4.14.y job log (0) log
2021/09/21 18:29 24m bisect fix linux-4.14.y job log (0) log
2021/08/22 14:59 25m bisect fix linux-4.14.y job log (0) log
2021/07/23 14:31 27m bisect fix linux-4.14.y job log (0) log
2021/06/16 01:58 21m bisect fix linux-4.14.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ex_handler_refcount+0x164/0x1a0 arch/x86/mm/extable.c:49
Write of size 4 at addr ffff8880aa4965d8 by task systemd-udevd/8152

CPU: 1 PID: 8152 Comm: systemd-udevd Not tainted 4.14.307-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
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:251
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:350
 kasan_report mm/kasan/report.c:408 [inline]
 __asan_report_store4_noabort+0x68/0x70 mm/kasan/report.c:433
 ex_handler_refcount+0x164/0x1a0 arch/x86/mm/extable.c:49
 fixup_exception+0x8a/0xd0 arch/x86/mm/extable.c:197
 do_trap_no_signal arch/x86/kernel/traps.c:208 [inline]
 do_trap+0x61/0x250 arch/x86/kernel/traps.c:257
 do_error_trap+0x132/0x2d0 arch/x86/kernel/traps.c:301
 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:967
RIP: 0010:flags_string.cold+0x1b3e/0x6c57
RSP: 0018:ffff8880953efcd0 EFLAGS: 00010296
RAX: 0000000000000000 RBX: ffff8880aa4965d8 RCX: ffff8880aa4965d8
RDX: 0000000000000004 RSI: 0000000000000003 RDI: 0000000000000001
RBP: ffffffff89512060 R08: 0000000000000000 R09: 0000000000000002
R10: 0000000000000000 R11: ffff8880b074e280 R12: 0000000000000000
R13: ffff88808a05e884 R14: ffffed101140bd5e R15: dffffc0000000000
 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
RIP: 0033:0x7f82dc537270
RSP: 002b:00007ffd4959f978 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f82dc537270
RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007
RBP: 00007f82dd3f1710 R08: 0000561ed15ae4d0 R09: 0000000000000018
R10: 0000561ed15ba798 R11: 0000000000000246 R12: 0000000000000000
R13: 0000561ed15bec20 R14: 0000000000000003 R15: 000000000000000e

Allocated by task 8128:
 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:2461
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:636
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x651/0xbc0 net/netlink/af_netlink.c:1900
 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 8136:
 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:228 [inline]
 nbd_genl_connect+0xcf6/0x13e0 drivers/block/nbd.c:1905
 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:2461
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:636
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x651/0xbc0 net/netlink/af_netlink.c:1900
 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

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

Memory state around the buggy address:
 ffff8880aa496480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880aa496500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880aa496580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff8880aa496600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880aa496680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (49):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/03/05 07:07 linux-4.14.y 7878a41b6cc1 f8902b57 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2023/03/03 18:24 linux-4.14.y 7878a41b6cc1 f8902b57 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2023/01/28 23:53 linux-4.14.y 3949d1610004 9dfcf09c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/10/15 19:39 linux-4.14.y 9d5c0b3a8e1a 67cb024c .config console log report syz C [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/07/20 20:53 linux-4.14.y 424a46ea058e 88cb1383 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/07/18 19:38 linux-4.14.y 424a46ea058e ff988920 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/07/07 23:32 linux-4.14.y 1048779a1d7d bff65f44 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/06/23 06:48 linux-4.14.y 84bae26850e3 912f5df7 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/06/15 08:30 linux-4.14.y 1ccc597f801c 127d1faf .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/06/11 12:17 linux-4.14.y b8f3be299d51 0d5abf15 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/05/31 02:03 linux-4.14.y 501eec4f9e13 af70c3a9 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/05/22 22:45 linux-4.14.y dffb5c6ff09c 7268fa62 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/05/22 12:40 linux-4.14.y dffb5c6ff09c 7268fa62 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/12/15 13:43 linux-4.14.y 9dfbac0e6b86 f752fb53 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/06/23 13:30 linux-4.14.y cfb41ef9deb1 aba2b2fb .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/05/17 01:58 linux-4.14.y 7d7d1c0ab3eb f54a5c09 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/05/16 13:32 linux-4.14.y 7d7d1c0ab3eb f54a5c09 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/05/13 03:16 linux-4.14.y 7d7d1c0ab3eb ed7d41c5 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/05/11 10:24 linux-4.14.y 7d7d1c0ab3eb ca873091 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/05/08 16:22 linux-4.14.y 7d7d1c0ab3eb bc5434be .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/04/11 22:27 linux-4.14.y 958e517f4e16 6a81331a .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/04/09 08:57 linux-4.14.y 0cc244011f40 6a81331a .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/04/06 17:19 linux-4.14.y bd634aa64163 6a81331a .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/04/03 06:25 linux-4.14.y bd634aa64163 6a81331a .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/04/01 05:36 linux-4.14.y bd634aa64163 6a81331a .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/03/31 09:24 linux-4.14.y bd634aa64163 6a81331a .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/02/20 19:08 linux-4.14.y 29c52025152b 3e5ed8b4 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2023/03/03 06: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 Write in ex_handler_refcount
2023/02/12 04:30 linux-4.14.y a8ad60f2af58 93e26d60 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2023/01/19 19:22 linux-4.14.y 97205fccccdc 71197f3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/12/25 15:28 linux-4.14.y c4215ee4771b 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/12/08 12:16 linux-4.14.y 179ef7fe8677 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/12/07 12:23 linux-4.14.y 179ef7fe8677 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/10/25 19:40 linux-4.14.y 9d5c0b3a8e1a 45645420 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/09/12 02:02 linux-4.14.y 65640c873dcf 356d8217 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/09/11 14:14 linux-4.14.y 65640c873dcf 356d8217 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/08/22 00:40 linux-4.14.y b641242202ed 26a13b38 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/05/06 14:59 linux-4.14.y e3a56aaade89 efeff0a5 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/04/12 04:57 linux-4.14.y 74766a973637 af01ee7d .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/03/06 10:25 linux-4.14.y e853993d29aa 7bdd8b2c .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/03/01 21:35 linux-4.14.y fa33f9094f36 45a13a73 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/01/20 05:34 linux-4.14.y 4ba8e26127c3 5da9499f .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/01/15 08:31 linux-4.14.y 4ba8e26127c3 723cfaf0 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2022/01/12 21:51 linux-4.14.y 4ba8e26127c3 44d1319a .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/12/17 15:00 linux-4.14.y 9dfbac0e6b86 44068e19 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/04/20 23:31 linux-4.14.y cf256fbcbe34 c0ced557 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/04/09 20:00 linux-4.14.y 0cc244011f40 6a81331a .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/03/19 16:10 linux-4.14.y cb83ddcd5332 2af9d324 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
2021/03/08 14:13 linux-4.14.y 1d177c0872ab 09fbf400 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in ex_handler_refcount
* Struck through repros no longer work on HEAD.