syzbot


KASAN: use-after-free Read in rtnl_newlink

Status: upstream: reported C repro on 2020/05/22 00:38
Reported-by: syzbot+d293ff4bc139bc55ff94@syzkaller.appspotmail.com
First crash: 1433d, last: 414d
Fix bisection: failed (error log, bisect log)
  

Sample crash report:
netlink: 8 bytes leftover after parsing attributes in process `syz-executor787'.
netlink: 8 bytes leftover after parsing attributes in process `syz-executor787'.
==================================================================
BUG: KASAN: use-after-free in rtnl_newlink+0x1530/0x15c0 net/core/rtnetlink.c:3149
Read of size 1 at addr ffff88809532c7a8 by task syz-executor787/8094

CPU: 0 PID: 8094 Comm: syz-executor787 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/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_load1_noabort+0x88/0x90 mm/kasan/report.c:430
 rtnl_newlink+0x1530/0x15c0 net/core/rtnetlink.c:3149
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 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
RIP: 0033:0x7fe5ec064ff9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc8f3d6ff8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000008ce8 RCX: 00007fe5ec064ff9
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007ffc8f3d7198 R09: 00007ffc8f3d7198
R10: 00007ffc8f3d7198 R11: 0000000000000246 R12: 00007ffc8f3d700c
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000

Allocated by task 8094:
 __do_kmalloc_node mm/slab.c:3689 [inline]
 __kmalloc_node+0x4c/0x70 mm/slab.c:3696
 kmalloc_node include/linux/slab.h:557 [inline]
 kvmalloc_node+0xb4/0xf0 mm/util.c:423
 kvmalloc include/linux/mm.h:577 [inline]
 kvzalloc include/linux/mm.h:585 [inline]
 alloc_netdev_mqs+0x97/0xd50 net/core/dev.c:9152
 rtnl_create_link+0x1d4/0xa40 net/core/rtnetlink.c:2869
 rtnl_newlink+0xf45/0x15c0 net/core/rtnetlink.c:3131
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 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 8094:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 kvfree+0x59/0x60 mm/util.c:452
 netdev_freemem net/core/dev.c:9106 [inline]
 free_netdev+0x364/0x410 net/core/dev.c:9257
 device_release+0x76/0x210 drivers/base/core.c:1076
 kobject_cleanup lib/kobject.c:662 [inline]
 kobject_release lib/kobject.c:691 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put+0x28b/0x5d0 lib/kobject.c:708
 put_device drivers/base/core.c:2267 [inline]
 device_unregister+0x35/0xc0 drivers/base/core.c:2379
 register_netdevice+0x901/0x10f0 net/core/dev.c:8791
 nsim_newlink+0x162/0x1c0 drivers/net/netdevsim/netdev.c:555
 rtnl_newlink+0x1030/0x15c0 net/core/rtnetlink.c:3141
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4782
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 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 ffff88809532c240
 which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 1384 bytes inside of
 8192-byte region [ffff88809532c240, ffff88809532e240)
The buggy address belongs to the page:
page:ffffea000254cb00 count:1 mapcount:0 mapping:ffff88813bff2080 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea0002c56008 ffff88813bff1b48 ffff88813bff2080
raw: 0000000000000000 ffff88809532c240 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809532c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809532c700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809532c780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff88809532c800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809532c880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (77):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/24 10:39 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/10/13 04:03 linux-4.19.y 3f8a27f9e27b 3f6b40a1 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/02/20 17:12 linux-4.19.y 3f8a27f9e27b 3cd800e4 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2023/03/07 01:48 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2023/01/24 10:24 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/12/29 12:26 linux-4.19.y 3f8a27f9e27b 44712fbc .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/11/14 17:28 linux-4.19.y 3f8a27f9e27b 943f4cb8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/11/10 03:50 linux-4.19.y 3f8a27f9e27b b2488a87 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/11/10 02:15 linux-4.19.y 3f8a27f9e27b b2488a87 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/10/13 03:48 linux-4.19.y 3f8a27f9e27b 3f6b40a1 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/09/09 11:35 linux-4.19.y 3f8a27f9e27b 90058bdc .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/09/04 23:45 linux-4.19.y 3f8a27f9e27b 28811d0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/09/02 03:47 linux-4.19.y 3f8a27f9e27b a805568e .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/31 11:53 linux-4.19.y 3f8a27f9e27b 51e54e30 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/29 16:43 linux-4.19.y 3f8a27f9e27b d7593c58 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/27 02:58 linux-4.19.y 3f8a27f9e27b 07177916 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/23 11:12 linux-4.19.y 3f8a27f9e27b cea8b0f7 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/21 02:48 linux-4.19.y 3f8a27f9e27b 26a13b38 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/17 07:32 linux-4.19.y 3f8a27f9e27b 9e4b39c2 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/14 19:09 linux-4.19.y 3f8a27f9e27b 8dfcaa3d .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/13 21:38 linux-4.19.y 3f8a27f9e27b 8dfcaa3d .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/08/07 21:43 linux-4.19.y 3f8a27f9e27b 88e3a122 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/07/25 11:20 linux-4.19.y 3f8a27f9e27b 664c519c .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/07/05 16:40 linux-4.19.y 3f8a27f9e27b bff65f44 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/07/05 15:15 linux-4.19.y 3f8a27f9e27b bff65f44 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/07/01 18:13 linux-4.19.y 3f8a27f9e27b 1434eec0 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/06/21 01:09 linux-4.19.y 3f8a27f9e27b 0fc5c330 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/06/20 08:00 linux-4.19.y 3f8a27f9e27b 8f633d84 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/05/31 09:37 linux-4.19.y 3f8a27f9e27b af70c3a9 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/05/27 20:28 linux-4.19.y 3f8a27f9e27b a46af346 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/04/30 09:46 linux-4.19.y 3f8a27f9e27b 2df221f6 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/04/29 13:34 linux-4.19.y 3f8a27f9e27b e9076525 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/04/14 16:54 linux-4.19.y 3f8a27f9e27b b17b2923 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/04/09 12:53 linux-4.19.y 3f8a27f9e27b e22c3da3 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/04/09 08:18 linux-4.19.y 3f8a27f9e27b e22c3da3 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/04/06 09:36 linux-4.19.y 3f8a27f9e27b 86b4b7f8 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/04/01 15:34 linux-4.19.y 3f8a27f9e27b 79a2a8fc .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/03/16 13:00 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/02/25 05:30 linux-4.19.y 3f8a27f9e27b 7c337266 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/02/20 08:31 linux-4.19.y 3f8a27f9e27b 3cd800e4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/02/18 18:25 linux-4.19.y 3f8a27f9e27b 3cd800e4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/29 14:55 linux-4.19.y 3f8a27f9e27b 495e00c5 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/23 17:40 linux-4.19.y 3f8a27f9e27b 214351e1 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/19 18:20 linux-4.19.y 3f8a27f9e27b 0620189b .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/12 17:58 linux-4.19.y 3f8a27f9e27b 44d1319a .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/11 17:14 linux-4.19.y 3f8a27f9e27b 1884f55a .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/09 04:40 linux-4.19.y 3f8a27f9e27b 2ca0d385 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/09 00:58 linux-4.19.y 3f8a27f9e27b 2ca0d385 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2022/01/07 01:43 linux-4.19.y 3f8a27f9e27b 6acc789a .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/12/17 09:03 linux-4.19.y 3f8a27f9e27b 44068e19 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/12/14 13:00 linux-4.19.y 3f8a27f9e27b d018dd31 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/12/12 12:59 linux-4.19.y 3f8a27f9e27b 49ca1f59 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/12/11 22:56 linux-4.19.y 3f8a27f9e27b 49ca1f59 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/12/10 01:55 linux-4.19.y 3f8a27f9e27b 4d4ce9bc .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/11/09 13:45 linux-4.19.y 3f8a27f9e27b 59bcaf9a .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/11/06 02:39 linux-4.19.y 3f8a27f9e27b 4c1be0be .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/10/23 07:52 linux-4.19.y 3f8a27f9e27b 282f03fb .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/09/22 11:40 linux-4.19.y 2950c9c5e0df 169724fe .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/09/20 21:51 linux-4.19.y b172b44fcb17 af796c18 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/09/17 02:11 linux-4.19.y b172b44fcb17 5b989942 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/09/02 00:32 linux-4.19.y e23d55af0e1f 7eb7e152 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/06/02 09:27 linux-4.19.y 6b7b0056defc 0740de69 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/05/17 10:32 linux-4.19.y 3c8c23092588 a2eb125d .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/05/04 14:12 linux-4.19.y 97a8651cadce 06c27ff5 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/02/23 15:42 linux-4.19.y 2d19be4653f5 fcc6d71b .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2021/02/19 15:16 linux-4.19.y 255b58a2b3af f689d40a .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in rtnl_newlink
2020/12/03 13:18 linux-4.19.y daefdc9eb24b 59ad4022 .config console log report info ci2-linux-4-19
2020/11/08 06:48 linux-4.19.y b94de4d19498 cba33199 .config console log report info ci2-linux-4-19
2020/11/03 08:46 linux-4.19.y f5d8eef067ac cba33199 .config console log report info ci2-linux-4-19
2020/11/02 20:45 linux-4.19.y f5d8eef067ac 7f344fa6 .config console log report info ci2-linux-4-19
2020/10/24 12:32 linux-4.19.y ad326970d25c a1839e81 .config console log report info ci2-linux-4-19
2020/10/24 12:04 linux-4.19.y ad326970d25c a1839e81 .config console log report info ci2-linux-4-19
2020/10/19 00:37 linux-4.19.y ad326970d25c fea47c01 .config console log report info ci2-linux-4-19
2020/06/24 10:39 linux-4.19.y b3a99fd385fa 41694dbf .config console log report ci2-linux-4-19
2020/06/21 15:11 linux-4.19.y 3fc898571b97 4f2acff9 .config console log report ci2-linux-4-19
2020/05/22 00:38 linux-4.19.y 1bab61d3e8cd 4afdfa20 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.