syzbot


KASAN: use-after-free Read in ip_tunnel_lookup

Status: auto-closed as invalid on 2020/07/27 23:03
Reported-by: syzbot+c0d9481d7996f0515957@syzkaller.appspotmail.com
First crash: 1699d, last: 1699d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ip_tunnel_lookup net 4 2063d 2139d 0/28 auto-closed as invalid on 2019/09/27 15:52

Sample crash report:
batman_adv: batadv0: Interface deactivated: batadv_slave_0
==================================================================
BUG: KASAN: use-after-free in ip_tunnel_lookup+0x9d3/0xb70 net/ipv4/ip_tunnel.c:142
Read of size 4 at addr ffff888059c57384 by task ksoftirqd/1/17

CPU: 1 PID: 17 Comm: ksoftirqd/1 Not tainted 4.14.174-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+0x13e/0x194 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1e2 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/0x2ae mm/kasan/report.c:393
 ip_tunnel_lookup+0x9d3/0xb70 net/ipv4/ip_tunnel.c:142
 vti4_err+0x28f/0x960 net/ipv4/ip_vti.c:334
 tunnel4_err+0x81/0x160 net/ipv4/tunnel4.c:157
 icmp_socket_deliver+0x1ba/0x330 net/ipv4/icmp.c:773
 icmp_unreach+0x2de/0x9d0 net/ipv4/icmp.c:890
 icmp_rcv+0x719/0x1300 net/ipv4/icmp.c:1071
 ip_local_deliver_finish+0x245/0xaa0 net/ipv4/ip_input.c:216
 NF_HOOK include/linux/netfilter.h:250 [inline]
 NF_HOOK include/linux/netfilter.h:244 [inline]
 ip_local_deliver+0x1a6/0x450 net/ipv4/ip_input.c:257
 dst_input include/net/dst.h:468 [inline]
 ip_rcv_finish+0x79b/0x1a10 net/ipv4/ip_input.c:396
 NF_HOOK include/linux/netfilter.h:250 [inline]
 NF_HOOK include/linux/netfilter.h:244 [inline]
 ip_rcv+0x9d8/0xfec net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x1e50/0x2c00 net/core/dev.c:4477
 __netif_receive_skb+0x27/0x1a0 net/core/dev.c:4515
 process_backlog+0x214/0x750 net/core/dev.c:5197
 napi_poll net/core/dev.c:5598 [inline]
 net_rx_action+0x456/0xe90 net/core/dev.c:5664
 __do_softirq+0x254/0x9bf kernel/softirq.c:288
 run_ksoftirqd kernel/softirq.c:670 [inline]
 run_ksoftirqd+0x87/0x1a0 kernel/softirq.c:662
 smpboot_thread_fn+0x5c1/0x920 kernel/smpboot.c:164
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 7394:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:529
 __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:8097
 __ip_tunnel_create+0x16a/0x440 net/ipv4/ip_tunnel.c:269
 ip_tunnel_init_net+0x272/0x520 net/ipv4/ip_tunnel.c:1039
 vti_init_net+0x2a/0x2f0 net/ipv4/ip_vti.c:497
 ops_init+0xa5/0x3c0 net/core/net_namespace.c:118
 setup_net+0x22f/0x500 net/core/net_namespace.c:295
 copy_net_ns+0x19b/0x440 net/core/net_namespace.c:419
 create_new_namespaces+0x375/0x730 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xa5/0x1e0 kernel/nsproxy.c:206
 SYSC_unshare kernel/fork.c:2391 [inline]
 SyS_unshare+0x2ea/0x740 kernel/fork.c:2341
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 2216:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcb/0x260 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+0x13e/0x1f0 lib/kobject.c:692
 netdev_run_todo+0x4a9/0x710 net/core/dev.c:7954
 ip_tunnel_delete_net+0x260/0x300 net/ipv4/ip_tunnel.c:1086
 ops_exit_list.isra.0+0x9d/0x140 net/core/net_namespace.c:142
 cleanup_net+0x3bb/0x820 net/core/net_namespace.c:484
 process_one_work+0x813/0x1540 kernel/workqueue.c:2116
 worker_thread+0x5d1/0x1070 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff888059c56840
 which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 2884 bytes inside of
 4096-byte region [ffff888059c56840, ffff888059c57840)
The buggy address belongs to the page:
page:ffffea0001671580 count:1 mapcount:0 mapping:ffff888059c56840 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff888059c56840 0000000000000000 0000000100000001
raw: ffffea0001671420 ffffea00016719a0 ffff88812fe56dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888059c57280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888059c57300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888059c57380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff888059c57400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888059c57480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/29 23:02 linux-4.14.y 01364dad1d45 05736b29 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.