syzbot


KASAN: use-after-free Read in vlan_dev_get_iflink

Status: upstream: reported C repro on 2020/04/25 21:56
Reported-by: syzbot+4e67765f93c038b2789a@syzkaller.appspotmail.com
First crash: 1670d, last: 807d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in vlan_dev_get_iflink C error 18 744d 1683d 0/1 upstream: reported C repro on 2020/04/13 08:02
linux-5.15 KASAN: use-after-free Read in vlan_dev_get_iflink 4 83d 112d 0/3 upstream: reported on 2024/07/31 22:57
upstream KASAN: use-after-free Read in vlan_dev_get_iflink net C error error 13 1412d 1582d 0/28 auto-obsoleted due to no activity on 2022/09/27 12:32
android-5-15 KASAN: use-after-free Read in vlan_dev_get_iflink 2 50d 100d 0/2 premoderation: reported on 2024/08/13 02:40
Fix bisection attempts (23)
Created Duration User Patch Repo Result
2022/10/13 02:20 0m bisect fix linux-4.14.y error job log
2022/09/06 14:53 26m bisect fix linux-4.14.y OK (0) job log log
2022/08/07 14:17 24m bisect fix linux-4.14.y OK (0) job log log
2022/07/08 13:46 30m bisect fix linux-4.14.y OK (0) job log log
2022/06/08 13:19 27m bisect fix linux-4.14.y OK (0) job log log
2022/05/09 12:32 32m bisect fix linux-4.14.y OK (0) job log log
2022/04/08 08:26 24m bisect fix linux-4.14.y OK (0) job log log
2022/03/08 21:50 32m bisect fix linux-4.14.y OK (0) job log log
2022/02/06 16:37 28m bisect fix linux-4.14.y OK (0) job log log
2022/01/07 16:09 27m bisect fix linux-4.14.y OK (0) job log log
2021/12/08 15:40 29m bisect fix linux-4.14.y OK (0) job log log
2021/11/08 15:13 26m bisect fix linux-4.14.y OK (0) job log log
2021/10/09 14:47 25m bisect fix linux-4.14.y OK (0) job log log
2021/09/09 14:18 29m bisect fix linux-4.14.y OK (0) job log log
2021/08/10 13:45 25m bisect fix linux-4.14.y OK (0) job log log
2021/07/11 13:19 26m bisect fix linux-4.14.y OK (0) job log log
2021/06/11 12:48 30m bisect fix linux-4.14.y OK (0) job log log
2021/05/12 12:20 28m bisect fix linux-4.14.y OK (0) job log log
2021/04/12 11:50 30m bisect fix linux-4.14.y OK (0) job log log
2021/02/27 23:22 22m bisect fix linux-4.14.y OK (0) job log log
2020/11/24 11:11 24m bisect fix linux-4.14.y OK (0) job log log
2020/10/25 10:48 23m bisect fix linux-4.14.y OK (0) job log log
2020/09/25 10:23 24m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x5f/0x70 net/8021q/vlan_dev.c:769
Read of size 4 at addr ffff8880905e0488 by task syz-executor582/6951

CPU: 0 PID: 6951 Comm: syz-executor582 Not tainted 4.14.192-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 vlan_dev_get_iflink+0x5f/0x70 net/8021q/vlan_dev.c:769
 dev_get_iflink+0x73/0xe0 net/core/dev.c:691
 rfc2863_policy+0x163/0x1b0 net/core/link_watch.c:43
 linkwatch_do_dev+0x1b/0xf0 net/core/link_watch.c:157
 linkwatch_forget_dev+0x15c/0x1f0 net/core/link_watch.c:223
 netdev_wait_allrefs net/core/dev.c:7837 [inline]
 netdev_run_todo+0x284/0xad0 net/core/dev.c:7938
 rtnl_unlock net/core/rtnetlink.c:106 [inline]
 rtnetlink_rcv_msg+0x3cb/0xb10 net/core/rtnetlink.c:4318
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 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:0x446d79
RSP: 002b:00007efc89777d98 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000006dbc78 RCX: 0000000000446d79
RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000003
RBP: 00000000006dbc70 R08: 0000000000000018 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000246 R12: 00000000006dbc7c
R13: 0000000000040000 R14: 0000000000000000 R15: 0705001000000048

Allocated by task 6917:
 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:397
 kvmalloc include/linux/mm.h:531 [inline]
 kvzalloc include/linux/mm.h:539 [inline]
 alloc_netdev_mqs+0x76/0xb70 net/core/dev.c:8103
 rtnl_create_link+0x1ab/0x890 net/core/rtnetlink.c:2460
 rtnl_newlink+0xe86/0x1830 net/core/rtnetlink.c:2718
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4316
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 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 6917:
 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:416
 device_release+0x15f/0x1a0 drivers/base/core.c:833
 kobject_cleanup lib/kobject.c:646 [inline]
 kobject_release lib/kobject.c:675 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put+0x1f3/0x2d0 lib/kobject.c:692
 netdev_run_todo+0x747/0xad0 net/core/dev.c:7960
 rtnl_unlock net/core/rtnetlink.c:106 [inline]
 rtnetlink_rcv_msg+0x3cb/0xb10 net/core/rtnetlink.c:4318
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 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 ffff8880905e0380
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 264 bytes inside of
 4096-byte region [ffff8880905e0380, ffff8880905e1380)
The buggy address belongs to the page:
page:ffffea0002417800 count:1 mapcount:0 mapping:ffff8880905e0380 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880905e0380 0000000000000000 0000000100000001
raw: ffffea000243ba20 ffffea000249a2a0 ffff88812fe52dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880905e0380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880905e0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880905e0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff8880905e0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880905e0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/06 07:01 linux-4.14.y ca4f2c56d416 0487ea6f .config console log report syz C ci2-linux-4-14
2021/03/13 11:49 linux-4.14.y c7150cd2fa8c 4a003785 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in vlan_dev_get_iflink
2021/01/28 22:26 linux-4.14.y 2d2791fce891 7df34f59 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in vlan_dev_get_iflink
2021/01/28 13:41 linux-4.14.y 2d2791fce891 eefc07f2 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in vlan_dev_get_iflink
2021/01/13 07:42 linux-4.14.y f79dc86058bc 0cdd6185 .config console log report info ci2-linux-4-14
2020/12/26 05:14 linux-4.14.y 3f2ecb86cb90 821e0b09 .config console log report info ci2-linux-4-14
2020/12/03 20:50 linux-4.14.y c196b3a9c83a 59ad4022 .config console log report info ci2-linux-4-14
2020/12/02 19:42 linux-4.14.y c196b3a9c83a eff43e99 .config console log report info ci2-linux-4-14
2020/08/26 10:23 linux-4.14.y d7e78d08fa77 344da168 .config console log report ci2-linux-4-14
2020/08/06 05:56 linux-4.14.y ca4f2c56d416 0487ea6f .config console log report ci2-linux-4-14
2020/04/27 18:30 linux-4.14.y 050272a0423e 0ce7569e .config console log report ci2-linux-4-14
2020/04/25 21:55 linux-4.14.y 050272a0423e b8bb8e5f .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.