syzbot


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

Status: upstream: reported C repro on 2021/03/29 13:41
Reported-by: syzbot+a2d92f19728cc7ea347f@syzkaller.appspotmail.com
First crash: 1333d, last: 627d
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 1504d 1504d 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 1541d 1750d 1/1 fixed on 2020/10/03 03:40
android-54 KASAN: use-after-free Write in ex_handler_refcount syz 4 1543d 1545d 0/2 auto-obsoleted due to no activity on 2023/04/15 04:57
linux-4.14 KASAN: use-after-free Write in ex_handler_refcount (3) C error 49 627d 1370d 0/1 upstream: reported C repro on 2021/02/20 19:09
linux-4.19 KASAN: use-after-free Write in ex_handler_refcount C done 11 1541d 1750d 1/1 fixed on 2020/10/02 13:00
Fix bisection attempts (5)
Created Duration User Patch Repo Result
2021/10/19 09:32 15m bisect fix linux-4.19.y error job log
2021/09/19 08:59 27m bisect fix linux-4.19.y OK (0) job log log
2021/08/20 07:42 27m bisect fix linux-4.19.y OK (0) job log log
2021/07/21 04:29 24m bisect fix linux-4.19.y OK (0) job log log
2021/06/21 03:51 32m bisect fix linux-4.19.y OK (0) job log log

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

CPU: 1 PID: 8389 Comm: systemd-udevd Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_store4_noabort+0x88/0x90 mm/kasan/report.c:437
 ex_handler_refcount+0x18f/0x1c0 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:209 [inline]
 do_trap+0x61/0x250 arch/x86/kernel/traps.c:258
 do_error_trap+0x15d/0x310 arch/x86/kernel/traps.c:303
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038
RIP: 0010:__noinstr_text_end+0x243b/0x7813
Code: 0f 0b 48 8d 4b 50 0f 0b 48 8d 4b 08 0f 0b 48 8d 4d 08 0f 0b 48 8d 8d 08 02 00 00 0f 0b 48 8d 0b 0f 0b 48 8d 0b 0f 0b 48 8d 0b <0f> 0b 48 8d 4d 00 0f 0b 49 8d 0c 24 0f 0b 48 8d 8b c0 00 00 00 0f
RSP: 0018:ffff888095677cd8 EFLAGS: 00010296
RAX: 0000000000000000 RBX: ffff8880aa0f9158 RCX: ffff8880aa0f9158
RDX: 0000000000000004 RSI: 0000000000000004 RDI: 0000000000000001
RBP: 0000000000000000 R08: 0000000000000000 R09: fffffbfff14b7985
R10: ffffffff8a5bcc2b R11: 0000000000000000 R12: ffffffff8a5bcc20
R13: 0000000000000000 R14: 1ffff11011525c5d R15: dffffc0000000000
 nbd_put drivers/block/nbd.c:228 [inline]
 nbd_release+0x108/0x170 drivers/block/nbd.c:1462
 __blkdev_put+0x636/0x870 fs/block_dev.c:1819
 blkdev_close+0x86/0xb0 fs/block_dev.c:1888
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:193 [inline]
 exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f7be4d81270
Code: 73 01 c3 48 8b 0d 38 7d 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 59 c1 20 00 00 75 10 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ee fb ff ff 48 89 04 24
RSP: 002b:00007ffe6fa704f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f7be4d81270
RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007
RBP: 00007f7be5c3b710 R08: 0000000000000045 R09: 0000000000000018
R10: 000055b41d02a4f8 R11: 0000000000000246 R12: 0000000000000000
R13: 000055b41d01c1c0 R14: 0000000000000003 R15: 000000000000000e

Allocated by task 8387:
 kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 nbd_dev_add+0x44/0x890 drivers/block/nbd.c:1627
 nbd_genl_connect+0x4cc/0x1630 drivers/block/nbd.c:1773
 genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602
 genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:638
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8393:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 nbd_dev_remove drivers/block/nbd.c:223 [inline]
 nbd_put.part.0+0xfe/0x140 drivers/block/nbd.c:231
 nbd_put drivers/block/nbd.c:228 [inline]
 nbd_genl_connect+0x120e/0x1630 drivers/block/nbd.c:1913
 genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602
 genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:638
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880aa0f9080
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 216 bytes inside of
 512-byte region [ffff8880aa0f9080, ffff8880aa0f9280)
The buggy address belongs to the page:
page:ffffea0002a83e40 count:1 mapcount:0 mapping:ffff88813bff0940 index:0xffff8880aa0f9800
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002a48908 ffffea0002a59f08 ffff88813bff0940
raw: ffff8880aa0f9800 ffff8880aa0f9080 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880aa0f9000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880aa0f9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880aa0f9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff8880aa0f9180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880aa0f9200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (44):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/03/05 07:35 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2023/02/27 19:36 linux-4.19.y 3f8a27f9e27b 9189cb53 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2023/01/28 22:53 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/07/18 19:06 linux-4.19.y 3f8a27f9e27b ff988920 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/07/07 17:25 linux-4.19.y 3f8a27f9e27b bff65f44 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/06/23 06:16 linux-4.19.y 3f8a27f9e27b 912f5df7 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/06/11 04:49 linux-4.19.y 3f8a27f9e27b 0d5abf15 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/05/20 18:32 linux-4.19.y 3f8a27f9e27b bd37ad7e .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/02/07 11:39 linux-4.19.y 3f8a27f9e27b a7dab638 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/05/21 12:09 linux-4.19.y 3c8c23092588 3c7fef33 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/05/15 01:39 linux-4.19.y 3c8c23092588 8bdd5343 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/05/14 07:43 linux-4.19.y 3c8c23092588 8bdd5343 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/05/12 12:45 linux-4.19.y 3c8c23092588 86294427 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/05/08 18:14 linux-4.19.y 3c8c23092588 bc5434be .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/04/25 16:19 linux-4.19.y 2965db2e004c 36c88236 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/04/15 04:05 linux-4.19.y 0f1b4cb77d7f fcdb12ba .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/04/14 13:14 linux-4.19.y 0f1b4cb77d7f 3134b37f .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/03/29 13:40 linux-4.19.y 78fec1611cbf a8529b82 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2023/01/28 22:28 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/11/19 07:46 linux-4.19.y 3f8a27f9e27b 5bb70014 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/09/14 06:18 linux-4.19.y 3f8a27f9e27b b884348d .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/08/28 04:39 linux-4.19.y 3f8a27f9e27b 07177916 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/07/21 13:40 linux-4.19.y 3f8a27f9e27b 6e67af9d .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/07/18 00:16 linux-4.19.y 3f8a27f9e27b 95cb00d1 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/07/12 23:15 linux-4.19.y 3f8a27f9e27b d91dd8ea .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/06/16 13:35 linux-4.19.y 3f8a27f9e27b 1719ee24 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/06/15 19:58 linux-4.19.y 3f8a27f9e27b 1719ee24 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/05/11 05:27 linux-4.19.y 3f8a27f9e27b 8d7b3b67 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/04/29 00:58 linux-4.19.y 3f8a27f9e27b e9076525 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/04/22 06:51 linux-4.19.y 3f8a27f9e27b 2738b391 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/04/20 07:42 linux-4.19.y 3f8a27f9e27b 7d7bc738 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/04/17 18:21 linux-4.19.y 3f8a27f9e27b 8bcc32a6 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/03/07 05:24 linux-4.19.y 3f8a27f9e27b 7bdd8b2c .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/02/25 10:40 linux-4.19.y 3f8a27f9e27b 7c337266 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/02/17 16:00 linux-4.19.y 3f8a27f9e27b 2bea8a27 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/02/12 19:32 linux-4.19.y 3f8a27f9e27b 8b9ca619 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/02/09 17:20 linux-4.19.y 3f8a27f9e27b 0b33604d .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/01/19 22:26 linux-4.19.y 3f8a27f9e27b 5da9499f .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/01/18 03:02 linux-4.19.y 3f8a27f9e27b 731a2d23 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2022/01/14 20:47 linux-4.19.y 3f8a27f9e27b 53e00b45 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/12/24 00:33 linux-4.19.y 3f8a27f9e27b 6caa12e4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/12/08 05:33 linux-4.19.y 3f8a27f9e27b 0230ba3e .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/10/21 08:32 linux-4.19.y 3f8a27f9e27b f111d03b .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
2021/07/21 07:23 linux-4.19.y 4938296e03bd 1b201b48 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in ex_handler_refcount
* Struck through repros no longer work on HEAD.