syzbot


KASAN: use-after-free Read in vxlan_fdb_destroy

Status: auto-closed as invalid on 2021/06/27 07:15
Reported-by: syzbot+a268b2272571cb7bdfd7@syzkaller.appspotmail.com
First crash: 1402d, last: 1365d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in vxlan_fdb_destroy 3 1639d 1687d 0/1 auto-closed as invalid on 2020/09/26 11:56
linux-4.19 general protection fault in vxlan_fdb_destroy C 1204 643d 1691d 0/1 upstream: reported C repro on 2020/04/06 21:46
linux-4.14 general protection fault in vxlan_fdb_destroy C inconclusive 520 709d 1691d 0/1 upstream: reported C repro on 2020/04/06 21:46

Sample crash report:
loop3: p5 size 1073741824 extends beyond EOD, truncated
loop3: p6 size 32768 extends beyond EOD, truncated
MINIX-fs: deleted inode referenced: 1
MINIX-fs: get root inode failed
==================================================================
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:457 [inline]
BUG: KASAN: use-after-free in vxlan_fdb_destroy+0x1cc/0x1f0 drivers/net/vxlan.c:788
Read of size 8 at addr ffff88809e9fcb80 by task syz-executor.2/6506

CPU: 0 PID: 6506 Comm: syz-executor.2 Not tainted 4.19.177-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 __hlist_del include/linux/list.h:676 [inline]
 hlist_del_rcu include/linux/rculist.h:457 [inline]
 vxlan_fdb_destroy+0x1cc/0x1f0 drivers/net/vxlan.c:788
 __vxlan_dev_create+0x477/0x820 drivers/net/vxlan.c:3277
 vxlan_newlink+0xc0/0x120 drivers/net/vxlan.c:3504
 rtnl_newlink+0x1027/0x15b0 net/core/rtnetlink.c:3141
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4778
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 sock_no_sendpage+0xf5/0x140 net/core/sock.c:2668
 kernel_sendpage net/socket.c:3378 [inline]
 sock_sendpage+0xdf/0x140 net/socket.c:847
 pipe_to_sendpage+0x268/0x330 fs/splice.c:452
 splice_from_pipe_feed fs/splice.c:503 [inline]
 __splice_from_pipe+0x389/0x800 fs/splice.c:627
 splice_from_pipe fs/splice.c:662 [inline]
 generic_splice_sendpage+0xd4/0x140 fs/splice.c:833
 do_splice_from fs/splice.c:852 [inline]
 do_splice fs/splice.c:1154 [inline]
 __do_sys_splice fs/splice.c:1428 [inline]
 __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x465ef9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2d458ad188 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 000000000056c008 RCX: 0000000000465ef9
RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00000000004bcd1c R08: 000000000004ffe2 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c008
R13: 00007ffefd63da0f R14: 00007f2d458ad300 R15: 0000000000022000

Allocated by task 6506:
 kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 vxlan_fdb_alloc drivers/net/vxlan.c:646 [inline]
 vxlan_fdb_create+0x163/0x690 drivers/net/vxlan.c:674
 __vxlan_dev_create+0x417/0x820 drivers/net/vxlan.c:3243
 vxlan_newlink+0xc0/0x120 drivers/net/vxlan.c:3504
 rtnl_newlink+0x1027/0x15b0 net/core/rtnetlink.c:3141
 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4778
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6bb/0xc40 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 sock_no_sendpage+0xf5/0x140 net/core/sock.c:2668
 kernel_sendpage net/socket.c:3378 [inline]
 sock_sendpage+0xdf/0x140 net/socket.c:847
 pipe_to_sendpage+0x268/0x330 fs/splice.c:452
 splice_from_pipe_feed fs/splice.c:503 [inline]
 __splice_from_pipe+0x389/0x800 fs/splice.c:627
 splice_from_pipe fs/splice.c:662 [inline]
 generic_splice_sendpage+0xd4/0x140 fs/splice.c:833
 do_splice_from fs/splice.c:852 [inline]
 do_splice fs/splice.c:1154 [inline]
 __do_sys_splice fs/splice.c:1428 [inline]
 __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 6459:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 __rcu_reclaim kernel/rcu/rcu.h:236 [inline]
 rcu_do_batch kernel/rcu/tree.c:2584 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
 rcu_process_callbacks+0x8ff/0x18b0 kernel/rcu/tree.c:2881
 __do_softirq+0x265/0x980 kernel/softirq.c:292

The buggy address belongs to the object at ffff88809e9fcb80
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
 96-byte region [ffff88809e9fcb80, ffff88809e9fcbe0)
The buggy address belongs to the page:
page:ffffea00027a7f00 count:1 mapcount:0 mapping:ffff88813bff04c0 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002826f08 ffffea00026c2548 ffff88813bff04c0
raw: 0000000000000000 ffff88809e9fc000 0000000100000020 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809e9fca80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff88809e9fcb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff88809e9fcb80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                   ^
 ffff88809e9fcc00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff88809e9fcc80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/02/27 07:14 linux-4.19.y 2d19be4653f5 4c37c133 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in vxlan_fdb_destroy
2021/01/20 14:07 linux-4.19.y 43d555d83c3f d4f4eca5 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in vxlan_fdb_destroy
* Struck through repros no longer work on HEAD.