syzbot


KASAN: slab-out-of-bounds Read in __sock_release

Status: auto-closed as invalid on 2019/09/23 04:10
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+4e3534860f36785f5d4f@syzkaller.appspotmail.com
First crash: 1849d, last: 1849d

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __sock_release+0x23e/0x2b0 net/socket.c:594
Read of size 8 at addr ffff8880a8f8e768 by task kworker/u4:9/11545

CPU: 0 PID: 11545 Comm: kworker/u4:9 Not tainted 5.0.0+ #138
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:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187
 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 __sock_release+0x23e/0x2b0 net/socket.c:594
 sock_release+0x18/0x20 net/socket.c:619
 inet_ctl_sock_destroy include/net/inet_common.h:56 [inline]
 icmpv6_sk_exit+0x11f/0x1c0 net/ipv6/icmp.c:961
 ops_exit_list.isra.0+0xb0/0x160 net/core/net_namespace.c:153
 cleanup_net+0x3fb/0x960 net/core/net_namespace.c:551
 process_one_work+0x98e/0x1790 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x357/0x430 kernel/kthread.c:253
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

Allocated by task 22651:
 save_stack+0x45/0xd0 mm/kasan/common.c:75
 set_track mm/kasan/common.c:87 [inline]
 __kasan_kmalloc mm/kasan/common.c:497 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511
 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3621
 kmalloc include/linux/slab.h:545 [inline]
 kzalloc include/linux/slab.h:740 [inline]
 apparmor_sk_alloc_security+0x87/0x110 security/apparmor/lsm.c:767
 security_sk_alloc+0x7d/0xc0 security/security.c:2019
 sk_prot_alloc+0xa5/0x2e0 net/core/sock.c:1610
 sk_alloc+0x39/0xf70 net/core/sock.c:1661
 inet6_create net/ipv6/af_inet6.c:183 [inline]
 inet6_create+0x360/0xf90 net/ipv6/af_inet6.c:110
 __sock_create+0x3e6/0x750 net/socket.c:1398
 sock_create_kern+0x3b/0x50 net/socket.c:1467
 inet_ctl_sock_create+0x9d/0x1f0 net/ipv4/af_inet.c:1623
 icmpv6_sk_init net/ipv6/icmp.c:975 [inline]
 icmpv6_sk_init+0x10b/0x2d0 net/ipv6/icmp.c:965
 ops_init+0xb6/0x410 net/core/net_namespace.c:129
 setup_net+0x2c5/0x730 net/core/net_namespace.c:314
 copy_net_ns+0x1d9/0x340 net/core/net_namespace.c:437
 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206
 ksys_unshare+0x440/0x980 kernel/fork.c:2549
 __do_sys_unshare kernel/fork.c:2617 [inline]
 __se_sys_unshare kernel/fork.c:2615 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2615
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 2528:
 save_stack+0x45/0xd0 mm/kasan/common.c:75
 set_track mm/kasan/common.c:87 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467
 __cache_free mm/slab.c:3498 [inline]
 kfree+0xcf/0x230 mm/slab.c:3821
 kvfree+0x61/0x70 mm/util.c:459
 __vunmap+0x345/0x450 mm/vmalloc.c:1540
 __vfree+0x41/0xd0 mm/vmalloc.c:1584
 vfree+0x5f/0x90 mm/vmalloc.c:1614
 __ebt_unregister_table+0x95d/0xc60 net/bridge/netfilter/ebtables.c:1143
 ebt_unregister_table+0x6b/0x80 net/bridge/netfilter/ebtables.c:1253
 frame_nat_net_exit+0x44/0x50 net/bridge/netfilter/ebtable_nat.c:103
 ops_exit_list.isra.0+0xb0/0x160 net/core/net_namespace.c:153
 cleanup_net+0x3fb/0x960 net/core/net_namespace.c:551
 process_one_work+0x98e/0x1790 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x357/0x430 kernel/kthread.c:253
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff8880a8f8e740
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 8 bytes to the right of
 32-byte region [ffff8880a8f8e740, ffff8880a8f8e760)
The buggy address belongs to the page:
page:ffffea0002a3e380 count:1 mapcount:0 mapping:ffff88812c3f01c0 index:0xffff8880a8f8efc1
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea0002957288 ffffea0002387a08 ffff88812c3f01c0
raw: ffff8880a8f8efc1 ffff8880a8f8e000 000000010000003e 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a8f8e600: fb fb fb fb fc fc fc fc 00 00 fc fc fc fc fc fc
 ffff8880a8f8e680: 00 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc
>ffff8880a8f8e700: 00 00 fc fc fc fc fc fc 00 00 fc fc fc fc fc fc
                                                          ^
 ffff8880a8f8e780: 00 00 fc fc fc fc fc fc fb fb fb fb fc fc fc fc
 ffff8880a8f8e800: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/03/27 04:10 net-old d29f5aa0bc0c 55684ce1 .config console log report ci-upstream-net-this-kasan-gce
* Struck through repros no longer work on HEAD.