KASAN: use-after-free Read in __vxlan_dev_create

4 views
Skip to first unread message

syzbot

unread,
Sep 26, 2020, 7:00:19 PM9/26/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cbfa1702 Linux 4.14.198
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1078b5ad900000
kernel config: https://syzkaller.appspot.com/x/.config?x=3990958d85b55e59
dashboard link: https://syzkaller.appspot.com/bug?extid=781ef4d9f9ce2867fd7c
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+781ef4...@syzkaller.appspotmail.com

==================================================================
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 drivers/net/vxlan.c:787 [inline]
BUG: KASAN: use-after-free in __vxlan_dev_create+0x8dc/0x970 drivers/net/vxlan.c:3278
Read of size 8 at addr ffff8880469a9380 by task syz-executor.0/26084

CPU: 1 PID: 26084 Comm: syz-executor.0 Not tainted 4.14.198-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_load8_noabort+0x68/0x70 mm/kasan/report.c:430
__hlist_del include/linux/list.h:676 [inline]
hlist_del_rcu include/linux/rculist.h:427 [inline]
vxlan_fdb_destroy drivers/net/vxlan.c:787 [inline]
__vxlan_dev_create+0x8dc/0x970 drivers/net/vxlan.c:3278
vxlan_newlink+0xa3/0xe0 drivers/net/vxlan.c:3499
rtnl_newlink+0xf88/0x1830 net/core/rtnetlink.c:2728
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
sock_no_sendpage+0xe2/0x110 net/core/sock.c:2595
kernel_sendpage net/socket.c:3407 [inline]
sock_sendpage+0xdf/0x140 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+0x326/0x7a0 fs/splice.c:626
splice_from_pipe fs/splice.c:661 [inline]
generic_splice_sendpage+0xc1/0x110 fs/splice.c:832
do_splice_from fs/splice.c:851 [inline]
do_splice fs/splice.c:1147 [inline]
SYSC_splice fs/splice.c:1402 [inline]
SyS_splice+0xd59/0x1380 fs/splice.c:1382
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45e179
RSP: 002b:00007f24b52bcc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 0000000000033ec0 RCX: 000000000045e179
RDX: 0000000000000007 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 000000000118d040 R08: 000000000004ffe2 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cff4
R13: 00007ffec34330af R14: 00007f24b52bd9c0 R15: 000000000118cff4

Allocated by task 26084:
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
kmem_cache_alloc_trace+0x131/0x3d0 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/0x970 drivers/net/vxlan.c:3244
vxlan_newlink+0xa3/0xe0 drivers/net/vxlan.c:3499
rtnl_newlink+0xf88/0x1830 net/core/rtnetlink.c:2728
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
sock_no_sendpage+0xe2/0x110 net/core/sock.c:2595
kernel_sendpage net/socket.c:3407 [inline]
sock_sendpage+0xdf/0x140 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+0x326/0x7a0 fs/splice.c:626
splice_from_pipe fs/splice.c:661 [inline]
generic_splice_sendpage+0xc1/0x110 fs/splice.c:832
do_splice_from fs/splice.c:851 [inline]
do_splice fs/splice.c:1147 [inline]
SYSC_splice fs/splice.c:1402 [inline]
SyS_splice+0xd59/0x1380 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 6338:
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
__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+0x780/0x1180 kernel/rcu/tree.c:2946
__do_softirq+0x254/0xa1d kernel/softirq.c:288

The buggy address belongs to the object at ffff8880469a9380
which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
96-byte region [ffff8880469a9380, ffff8880469a93e0)
The buggy address belongs to the page:
page:ffffea00011a6a40 count:1 mapcount:0 mapping:ffff8880469a9000 index:0x0
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff8880469a9000 0000000000000000 0000000100000020
raw: ffffea0002555d20 ffffea00027d6ee0 ffff88812fe504c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880469a9280: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff8880469a9300: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff8880469a9380: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
^
ffff8880469a9400: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff8880469a9480: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jan 24, 2021, 6:00:14 PM1/24/21
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages