KASAN: use-after-free Read in mpls_dev_sysctl_unregister

8 views
Skip to first unread message

syzbot

unread,
Apr 5, 2018, 9:02:02 AM4/5/18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot hit the following crash on upstream commit
f2d285669aae656dfeafa0bf25e86bbbc5d22329 (Tue Apr 3 17:45:39 2018 +0000)
Merge tag 'pm-4.17-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
syzbot dashboard link:
https://syzkaller.appspot.com/bug?extid=4454f745ea10df8e63d4

Unfortunately, I don't have any reproducer for this crash yet.
Raw console output:
https://syzkaller.appspot.com/x/log.txt?id=6156898088779776
Kernel config: https://syzkaller.appspot.com/x/.config?id=686016073509112605
compiler: gcc (GCC) 7.1.1 20170620
user-space arch: i386
CC: [amine.kh...@6wind.com dan.j.w...@intel.com
da...@davemloft.net d...@axtens.net dsa...@gmail.com f...@strlen.de
ktk...@virtuozzo.com linux-...@vger.kernel.org net...@vger.kernel.org
ro...@cumulusnetworks.com]

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+4454f7...@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.

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
==================================================================


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.

syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.
To upstream this report, please reply with:
#syz upstream

Dmitry Vyukov

unread,
Apr 19, 2018, 12:00:15 PM4/19/18
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
access and alloc/free stacks don't match
> --
> You received this message because you are subscribed to the Google Groups
> "syzkaller-upstream-moderation" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to syzkaller-upstream-m...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller-upstream-moderation/0000000000009f93e40569198b4d%40google.com.
> For more options, visit https://groups.google.com/d/optout.

syzbot

unread,
Feb 22, 2019, 5:22:12 AM2/22/19
to dvy...@google.com, syzkaller-upst...@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