syzbot


KASAN: use-after-free Read in vxlan_fdb_destroy

Status: auto-closed as invalid on 2020/09/26 11:56
Reported-by: syzbot+abaee57738299d679fdc@syzkaller.appspotmail.com
First crash: 1466d, last: 1417d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 general protection fault in vxlan_fdb_destroy C 1204 422d 1470d 0/1 upstream: reported C repro on 2020/04/06 21:46
linux-4.19 KASAN: use-after-free Read in vxlan_fdb_destroy 2 1144d 1181d 0/1 auto-closed as invalid on 2021/06/27 07:15

Sample crash report:
audit: type=1800 audit(1590753342.194:12556): pid=10838 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=17476 res=0
==================================================================
BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:676 [inline]
BUG: KASAN: use-after-free in hlist_del_rcu include/linux/rculist.h:427 [inline]
BUG: KASAN: use-after-free in vxlan_fdb_destroy+0x152/0x180 drivers/net/vxlan.c:787
Read of size 8 at addr ffff88808ba3c100 by task syz-executor.3/10843

CPU: 0 PID: 10843 Comm: syz-executor.3 Not tainted 4.14.182-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/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2b9 mm/kasan/report.c:393
 __hlist_del include/linux/list.h:676 [inline]
 hlist_del_rcu include/linux/rculist.h:427 [inline]
 vxlan_fdb_destroy+0x152/0x180 drivers/net/vxlan.c:787
 __vxlan_dev_create+0x3bc/0x710 drivers/net/vxlan.c:3270
 vxlan_newlink+0xa3/0xe0 drivers/net/vxlan.c:3491
 rtnl_newlink+0xecb/0x1720 net/core/rtnetlink.c:2728
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315
 netlink_rcv_skb+0x127/0x370 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+0x64a/0xbb0 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 sock_no_sendpage+0xe5/0x110 net/core/sock.c:2572
 kernel_sendpage+0x82/0xd0 net/socket.c:3407
 sock_sendpage+0x84/0xa0 net/socket.c:871
 pipe_to_sendpage+0x226/0x2d0 fs/splice.c:451
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x332/0x740 fs/splice.c:626
 splice_from_pipe+0xc6/0x120 fs/splice.c:661
 do_splice_from fs/splice.c:851 [inline]
 do_splice fs/splice.c:1147 [inline]
 SYSC_splice fs/splice.c:1402 [inline]
 SyS_splice+0xca0/0x1230 fs/splice.c:1382
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45ca29
RSP: 002b:00007f22f73efc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00000000005079c0 RCX: 000000000045ca29
RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 000000000078bfa0 R08: 000000000004ffe2 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000bae R14: 00000000004ce9f7 R15: 00007f22f73f06d4

Allocated by task 10843:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x14d/0x3f0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 vxlan_fdb_alloc drivers/net/vxlan.c:645 [inline]
 vxlan_fdb_create+0x11a/0x5d0 drivers/net/vxlan.c:673
 __vxlan_dev_create+0x370/0x710 drivers/net/vxlan.c:3236
 vxlan_newlink+0xa3/0xe0 drivers/net/vxlan.c:3491
 rtnl_newlink+0xecb/0x1720 net/core/rtnetlink.c:2728
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315
 netlink_rcv_skb+0x127/0x370 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+0x64a/0xbb0 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 sock_no_sendpage+0xe5/0x110 net/core/sock.c:2572
 kernel_sendpage+0x82/0xd0 net/socket.c:3407
 sock_sendpage+0x84/0xa0 net/socket.c:871
 pipe_to_sendpage+0x226/0x2d0 fs/splice.c:451
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x332/0x740 fs/splice.c:626
 splice_from_pipe+0xc6/0x120 fs/splice.c:661
 do_splice_from fs/splice.c:851 [inline]
 do_splice fs/splice.c:1147 [inline]
 SYSC_splice fs/splice.c:1402 [inline]
 SyS_splice+0xca0/0x1230 fs/splice.c:1382
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 7:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xaf/0x190 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcb/0x260 mm/slab.c:3815
 __rcu_reclaim kernel/rcu/rcu.h:195 [inline]
 rcu_do_batch kernel/rcu/tree.c:2699 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
 rcu_process_callbacks+0x78d/0x1180 kernel/rcu/tree.c:2946
 __do_softirq+0x254/0x9bf kernel/softirq.c:288

The buggy address belongs to the object at ffff88808ba3c100
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
 96-byte region [ffff88808ba3c100, ffff88808ba3c160)
audit: type=1800 audit(1590753342.224:12557): pid=10848 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=17478 res=0
The buggy address belongs to the page:
page:ffffea00022e8f00 count:1 mapcount:0 mapping:ffff88808ba3c000 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff88808ba3c000 0000000000000000 0000000100000020
raw: ffffea0002753fe0 ffffea0002950ca0 ffff8880aa8004c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808ba3c000: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff88808ba3c080: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff88808ba3c100: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                   ^
 ffff88808ba3c180: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff88808ba3c200: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/05/29 11:55 linux-4.14.y 4f68020fef1c d19ed305 .config console log report ci2-linux-4-14
2020/04/15 09:59 linux-4.14.y c10b57a567e4 3f3c5574 .config console log report ci2-linux-4-14
2020/04/11 07:11 linux-4.14.y 4520f06b03ae a8c6a3f8 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.