syzbot


KASAN: use-after-free Read in macvlan_dev_get_iflink

Status: upstream: reported C repro on 2020/03/06 01:40
Reported-by: syzbot+d11c860b0130db28056e@syzkaller.appspotmail.com
First crash: 1756d, last: 832d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in macvlan_dev_get_iflink net C done inconclusive 125 1008d 1642d 0/28 auto-obsoleted due to no activity on 2023/04/18 11:01
linux-4.19 KASAN: use-after-free Read in macvlan_dev_get_iflink C error 83 710d 1756d 0/1 upstream: reported C repro on 2020/03/06 01:52

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in macvlan_dev_get_iflink+0x5f/0x70 drivers/net/macvlan.c:1101
Read of size 4 at addr ffff8880931a0dc8 by task syz-executor132/8487

CPU: 1 PID: 8487 Comm: syz-executor132 Not tainted 4.14.292-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/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
 macvlan_dev_get_iflink+0x5f/0x70 drivers/net/macvlan.c:1101
 dev_get_iflink+0x73/0xe0 net/core/dev.c:691
 rfc2863_policy+0x163/0x1b0 net/core/link_watch.c:43
 linkwatch_do_dev+0x1b/0x100 net/core/link_watch.c:157
 linkwatch_forget_dev+0x15c/0x1f0 net/core/link_watch.c:223
 netdev_wait_allrefs net/core/dev.c:7846 [inline]
 netdev_run_todo+0x284/0xad0 net/core/dev.c:7947
 rtnl_unlock net/core/rtnetlink.c:106 [inline]
 rtnetlink_rcv_msg+0x3cb/0xb10 net/core/rtnetlink.c:4324
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 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+0x46/0xbb
RIP: 0033:0x7f13c9e86dd9
RSP: 002b:00007f13c9e17308 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f13c9f0e438 RCX: 00007f13c9e86dd9
RDX: 0000000000000000 RSI: 0000000020000340 RDI: 0000000000000006
RBP: 00007f13c9f0e430 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f13c9f0e43c
R13: 00007f13c9edc074 R14: 00f0ffffffffffff R15: 0000000000022000

Allocated by task 8462:
 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_node mm/slab.c:3682 [inline]
 __kmalloc_node+0x4c/0x70 mm/slab.c:3689
 kmalloc_node include/linux/slab.h:530 [inline]
 kvmalloc_node+0x46/0xd0 mm/util.c:430
 kvmalloc include/linux/mm.h:531 [inline]
 kvzalloc include/linux/mm.h:539 [inline]
 alloc_netdev_mqs+0x76/0xb70 net/core/dev.c:8112
 rtnl_create_link+0x1ab/0x890 net/core/rtnetlink.c:2460
 rtnl_newlink+0xe7a/0x1830 net/core/rtnetlink.c:2720
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 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+0x46/0xbb

Freed by task 8462:
 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
 kvfree+0x45/0x50 mm/util.c:449
 device_release+0x15f/0x1a0 drivers/base/core.c:848
 kobject_cleanup lib/kobject.c:646 [inline]
 kobject_release lib/kobject.c:675 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put+0x251/0x550 lib/kobject.c:692
 netdev_run_todo+0x747/0xad0 net/core/dev.c:7969
 rtnl_unlock net/core/rtnetlink.c:106 [inline]
 rtnetlink_rcv_msg+0x3cb/0xb10 net/core/rtnetlink.c:4324
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 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+0x46/0xbb

The buggy address belongs to the object at ffff8880931a0cc0
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 264 bytes inside of
 4096-byte region [ffff8880931a0cc0, ffff8880931a1cc0)
The buggy address belongs to the page:
page:ffffea00024c6800 count:1 mapcount:0 mapping:ffff8880931a0cc0 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff8880931a0cc0 0000000000000000 0000000100000001
raw: ffffea0002aa8120 ffffea00024c3420 ffff88813fe74dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880931a0c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8880931a0d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880931a0d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff8880931a0e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880931a0e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (75):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/09/13 07:06 linux-4.14.y 65640c873dcf f371ed7e .config console log report syz C [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/06/05 18:54 linux-4.14.y 501eec4f9e13 c8857892 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2020/03/14 12:18 linux-4.14.y 12cd844a39ed 749688d2 .config console log report syz C ci2-linux-4-14
2021/06/22 18:13 linux-4.14.y cfb41ef9deb1 aba2b2fb .config console log report syz ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2020/03/06 02:54 linux-4.14.y 78d697fc93f9 b655d91b .config console log report syz ci2-linux-4-14
2022/09/15 22:38 linux-4.14.y 5df8b4735177 dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/08/27 10:39 linux-4.14.y e548869f356f 07177916 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/08/07 02:02 linux-4.14.y b641242202ed 88e3a122 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/08/02 12:24 linux-4.14.y b641242202ed fef302b1 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/07/24 03:21 linux-4.14.y 9c3bf9cf362f 22343af4 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/07/15 21:27 linux-4.14.y 424a46ea058e 5d921b08 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/07/01 14:04 linux-4.14.y f051383ef03b 1434eec0 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/04/13 15:42 linux-4.14.y 74766a973637 b17b2923 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/04/01 15:11 linux-4.14.y af1af6ebca0e 79a2a8fc .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/02/24 13:35 linux-4.14.y fa33f9094f36 b28851a4 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/02/17 15:00 linux-4.14.y a35d65bedfbc 2bea8a27 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/02/08 17:50 linux-4.14.y 21ad423fe521 0b33604d .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/01/31 20:24 linux-4.14.y b86ee2b7ae42 6b7c57fe .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/01/17 16:21 linux-4.14.y 4ba8e26127c3 731a2d23 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/01/13 04:47 linux-4.14.y 4ba8e26127c3 44d1319a .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2022/01/05 20:26 linux-4.14.y bfdef05c8da4 6acc789a .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2021/04/20 12:37 linux-4.14.y cf256fbcbe34 c0ced557 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2021/02/11 09:26 linux-4.14.y 2c8a3fceddf0 a52ee10a .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2021/01/24 21:38 linux-4.14.y 2d2791fce891 52e37319 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2021/01/24 16:26 linux-4.14.y 2d2791fce891 52e37319 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2021/01/20 16:11 linux-4.14.y 2762b48e9611 d4f4eca5 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in macvlan_dev_get_iflink
2020/12/31 00:20 linux-4.14.y 1752938529c6 ecb8c012 .config console log report info ci2-linux-4-14
2020/10/20 15:10 linux-4.14.y cbfa1702aaf6 ff4a3345 .config console log report info ci2-linux-4-14
2020/10/14 07:30 linux-4.14.y cbfa1702aaf6 fc7735a2 .config console log report info ci2-linux-4-14
2020/09/11 19:42 linux-4.14.y 458a534cac0c adfb8b4e .config console log report ci2-linux-4-14
2020/09/01 21:39 linux-4.14.y d7e78d08fa77 abf9ba4f .config console log report ci2-linux-4-14
2020/08/31 07:58 linux-4.14.y d7e78d08fa77 d5a3ae1f .config console log report ci2-linux-4-14
2020/08/21 16:37 linux-4.14.y 6a24ca2506d6 1d75fe45 .config console log report ci2-linux-4-14
2020/08/21 04:01 linux-4.14.y 14b58326976d 70160577 .config console log report ci2-linux-4-14
2020/08/14 19:12 linux-4.14.y 14b58326976d 5ce13532 .config console log report ci2-linux-4-14
2020/08/14 01:41 linux-4.14.y 14b58326976d 54ce1ed6 .config console log report ci2-linux-4-14
2020/08/13 08:43 linux-4.14.y 14b58326976d bc15f7db .config console log report ci2-linux-4-14
2020/08/04 19:47 linux-4.14.y 7f2c5eb458b8 80a06902 .config console log report ci2-linux-4-14
2020/08/03 18:28 linux-4.14.y 7f2c5eb458b8 96dd3623 .config console log report ci2-linux-4-14
2020/08/01 13:18 linux-4.14.y 7f2c5eb458b8 8df85ed9 .config console log report ci2-linux-4-14
2020/07/31 14:16 linux-4.14.y e5a54aa2d312 8df85ed9 .config console log report ci2-linux-4-14
2020/07/30 19:05 linux-4.14.y e5a54aa2d312 b0947553 .config console log report ci2-linux-4-14
2020/07/23 11:16 linux-4.14.y 69b94dd6dcd1 340ea530 .config console log report ci2-linux-4-14
2020/07/22 08:55 linux-4.14.y 69b94dd6dcd1 21f1765e .config console log report ci2-linux-4-14
2020/07/21 11:37 linux-4.14.y b850307b279c d88894e6 .config console log report ci2-linux-4-14
2020/07/08 03:10 linux-4.14.y b850307b279c 08fc4ef1 .config console log report ci2-linux-4-14
2020/07/03 05:31 linux-4.14.y b850307b279c f30c14bf .config console log report ci2-linux-4-14
2020/06/17 06:17 linux-4.14.y b850307b279c b9f3810b .config console log report ci2-linux-4-14
2020/06/15 02:38 linux-4.14.y b850307b279c 2a22c77a .config console log report ci2-linux-4-14
2020/06/14 22:52 linux-4.14.y b850307b279c 2a22c77a .config console log report ci2-linux-4-14
2020/06/12 18:25 linux-4.14.y b850307b279c 3036d6fd .config console log report ci2-linux-4-14
2020/06/10 19:18 linux-4.14.y c6db52a88798 5caaad3a .config console log report ci2-linux-4-14
2020/05/31 04:44 linux-4.14.y 4f68020fef1c 6f3e1c7c .config console log report ci2-linux-4-14
2020/05/28 14:54 linux-4.14.y 4f68020fef1c c7192a2f .config console log report ci2-linux-4-14
2020/05/25 10:19 linux-4.14.y a41ba30d9df2 11284182 .config console log report ci2-linux-4-14
2020/05/24 21:13 linux-4.14.y a41ba30d9df2 ce7ca010 .config console log report ci2-linux-4-14
2020/05/24 21:11 linux-4.14.y a41ba30d9df2 ce7ca010 .config console log report ci2-linux-4-14
2020/05/21 16:12 linux-4.14.y a41ba30d9df2 4afdfa20 .config console log report ci2-linux-4-14
2020/05/21 04:12 linux-4.14.y a41ba30d9df2 4afdfa20 .config console log report ci2-linux-4-14
2020/05/20 23:27 linux-4.14.y a41ba30d9df2 4afdfa20 .config console log report ci2-linux-4-14
2020/05/08 04:00 linux-4.14.y d71f695ce745 6c70a1c2 .config console log report ci2-linux-4-14
2020/05/05 02:56 linux-4.14.y 773e2b1cd56a 9941337c .config console log report ci2-linux-4-14
2020/05/02 21:38 linux-4.14.y 773e2b1cd56a 58da4c35 .config console log report ci2-linux-4-14
2020/05/02 21:25 linux-4.14.y 773e2b1cd56a 58da4c35 .config console log report ci2-linux-4-14
2020/04/30 23:50 linux-4.14.y 050272a0423e 3698959a .config console log report ci2-linux-4-14
2020/04/28 21:58 linux-4.14.y 050272a0423e e3ecea2e .config console log report ci2-linux-4-14
2020/04/21 04:58 linux-4.14.y c10b57a567e4 98a9f9e6 .config console log report ci2-linux-4-14
2020/04/20 18:50 linux-4.14.y c10b57a567e4 347a5dc3 .config console log report ci2-linux-4-14
2020/04/20 05:00 linux-4.14.y c10b57a567e4 9f7c6d12 .config console log report ci2-linux-4-14
2020/04/09 20:44 linux-4.14.y 4520f06b03ae a8c6a3f8 .config console log report ci2-linux-4-14
2020/04/08 01:43 linux-4.14.y 4520f06b03ae db9bcd4b .config console log report ci2-linux-4-14
2020/03/25 02:34 linux-4.14.y 01364dad1d45 68660b21 .config console log report ci2-linux-4-14
2020/03/15 20:32 linux-4.14.y 12cd844a39ed 749688d2 .config console log report ci2-linux-4-14
2020/03/06 01:39 linux-4.14.y 78d697fc93f9 b655d91b .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.