syzbot


KASAN: use-after-free Read in mpls_dev_sysctl_unregister

Status: auto-closed as invalid on 2019/02/22 10:22
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+4454f745ea10df8e63d4@syzkaller.appspotmail.com
First crash: 2225d, last: 2225d

Sample crash report:
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
==================================================================
BUG: KASAN: use-after-free in mpls_dev_sysctl_unregister+0xbb/0xc0 net/mpls/af_mpls.c:1388
Read of size 8 at addr ffff8801ae6c6e98 by task kworker/u4:4/198

CPU: 0 PID: 198 Comm: kworker/u4:4 Not tainted 4.16.0+ #288
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1a7/0x27d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 mpls_dev_sysctl_unregister+0xbb/0xc0 net/mpls/af_mpls.c:1388
 mpls_dev_notify+0x668/0x980 net/mpls/af_mpls.c:1575
 notifier_call_chain+0x136/0x2c0 kernel/notifier.c:93
 __raw_notifier_call_chain kernel/notifier.c:394 [inline]
 raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401
 call_netdevice_notifiers_info+0x32/0x70 net/core/dev.c:1707
 call_netdevice_notifiers net/core/dev.c:1725 [inline]
 rollback_registered_many+0x8b5/0xe20 net/core/dev.c:7406
 unregister_netdevice_many.part.120+0x87/0x420 net/core/dev.c:8481
 unregister_netdevice_many+0xbb/0x100 net/core/dev.c:8480
 ip_tunnel_delete_nets+0x4cb/0x6b0 net/ipv4/ip_tunnel.c:1084
 vti_exit_batch_net+0x22/0x30 net/ipv4/ip_vti.c:447
 ops_exit_list.isra.6+0x100/0x150 net/core/net_namespace.c:145
 cleanup_net+0x6a1/0xcd0 net/core/net_namespace.c:517
 process_one_work+0xc97/0x1c40 kernel/workqueue.c:2113
 worker_thread+0x1c3/0x1380 kernel/workqueue.c:2247
 kthread+0x33c/0x400 kernel/kthread.c:238
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:411

Allocated by task 25157:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
 __do_kmalloc mm/slab.c:3706 [inline]
 __kmalloc+0x162/0x760 mm/slab.c:3715
 kmalloc include/linux/slab.h:517 [inline]
 kzalloc include/linux/slab.h:701 [inline]
 kobject_get_path+0xb9/0x190 lib/kobject.c:152
 kobject_uevent_env+0x212/0xd30 lib/kobject_uevent.c:448
 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:565
 rx_queue_add_kobject net/core/net-sysfs.c:935 [inline]
 net_rx_queue_update_kobjects+0x42b/0x590 net/core/net-sysfs.c:954
 register_queue_kobjects net/core/net-sysfs.c:1397 [inline]
 netdev_register_kobject+0x271/0x360 net/core/net-sysfs.c:1608
 register_netdevice+0xa94/0xf70 net/core/dev.c:7900
 register_netdev+0x1a/0x30 net/core/dev.c:8014
 ip6gre_init_net+0x3b1/0x640 net/ipv6/ip6_gre.c:1495
 ops_init+0x10a/0x580 net/core/net_namespace.c:118
 setup_net+0x385/0x790 net/core/net_namespace.c:302
 copy_net_ns+0x253/0x5c0 net/core/net_namespace.c:426
 create_new_namespaces+0x432/0x890 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xae/0x1e0 kernel/nsproxy.c:206
 ksys_unshare+0x68a/0xe90 kernel/fork.c:2407
 SYSC_unshare kernel/fork.c:2475 [inline]
 SyS_unshare+0x15/0x20 kernel/fork.c:2473
 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
 do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392
 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139

Freed by task 25157:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
 __cache_free mm/slab.c:3486 [inline]
 kfree+0xd9/0x260 mm/slab.c:3801
 kobject_uevent_env+0x249/0xd30 lib/kobject_uevent.c:548
 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:565
 rx_queue_add_kobject net/core/net-sysfs.c:935 [inline]
 net_rx_queue_update_kobjects+0x42b/0x590 net/core/net-sysfs.c:954
 register_queue_kobjects net/core/net-sysfs.c:1397 [inline]
 netdev_register_kobject+0x271/0x360 net/core/net-sysfs.c:1608
 register_netdevice+0xa94/0xf70 net/core/dev.c:7900
 register_netdev+0x1a/0x30 net/core/dev.c:8014
 ip6gre_init_net+0x3b1/0x640 net/ipv6/ip6_gre.c:1495
 ops_init+0x10a/0x580 net/core/net_namespace.c:118
 setup_net+0x385/0x790 net/core/net_namespace.c:302
 copy_net_ns+0x253/0x5c0 net/core/net_namespace.c:426
 create_new_namespaces+0x432/0x890 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xae/0x1e0 kernel/nsproxy.c:206
 ksys_unshare+0x68a/0xe90 kernel/fork.c:2407
 SYSC_unshare kernel/fork.c:2475 [inline]
 SyS_unshare+0x15/0x20 kernel/fork.c:2473
 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
 do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392
 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139

The buggy address belongs to the object at ffff8801ae6c6e80
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 24 bytes inside of
 64-byte region [ffff8801ae6c6e80, ffff8801ae6c6ec0)
The buggy address belongs to the page:
page:ffffea0006b9b180 count:1 mapcount:0 mapping:ffff8801ae6c6000 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801ae6c6000 0000000000000000 0000000100000020
raw: ffffea000651bee0 ffffea0007605d20 ffff8801dac00340 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801ae6c6d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8801ae6c6e00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff8801ae6c6e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                            ^
 ffff8801ae6c6f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8801ae6c6f80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/04/05 10:57 upstream f2d285669aae 5e1ccffc .config console log report ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.