syzbot


KASAN: use-after-free Read in __ipv6_dev_get_saddr

Status: closed as invalid on 2018/02/13 20:17
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+7c7b53ba4fb22eee63c9@syzkaller.appspotmail.com
First crash: 2791d, last: 2791d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in __ipv6_dev_get_saddr 0 (1) 2018/01/04 14:02

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: use-after-free in __ipv6_dev_get_saddr+0x4ce/0x4f0 net/ipv6/addrconf.c:1603
Read of size 8 at addr ffff8801c3deb248 by task syz-executor1/11042

CPU: 0 PID: 11042 Comm: syz-executor1 Not tainted 4.15.0-rc4-next-20171221+ #78
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+0x194/0x257 lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report+0x25b/0x340 mm/kasan/report.c:409
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 __read_once_size include/linux/compiler.h:183 [inline]
 __ipv6_dev_get_saddr+0x4ce/0x4f0 net/ipv6/addrconf.c:1603
 ipv6_dev_get_saddr+0x701/0xa00 net/ipv6/addrconf.c:1771
 ip6_route_get_saddr include/net/ip6_route.h:116 [inline]
 ip6_dst_lookup_tail+0x298/0x940 net/ipv6/ip6_output.c:955
 ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1076
 rawv6_sendmsg+0xcf4/0x2bc0 net/ipv6/raw.c:908
 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:764
 sock_sendmsg_nosec net/socket.c:628 [inline]
 sock_sendmsg+0xca/0x110 net/socket.c:638
 SYSC_sendto+0x361/0x5c0 net/socket.c:1719
 SyS_sendto+0x40/0x50 net/socket.c:1687
 entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x452ac9
RSP: 002b:00007fc6cbfb3c58 EFLAGS: 00000212 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007fc6cbfb4700 RCX: 0000000000452ac9
RDX: 0000000000000000 RSI: 0000000020a80fcc RDI: 0000000000000013
RBP: 0000000000000000 R08: 0000000020599fe4 R09: 000000000000001c
R10: 0000000000000800 R11: 0000000000000212 R12: 0000000000000000
R13: 0000000000a2f7ef R14: 00007fc6cbfb49c0 R15: 0000000000000000

Allocated by task 3390:
 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:551
 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3611
 kmalloc include/linux/slab.h:516 [inline]
 kzalloc include/linux/slab.h:705 [inline]
 ipv6_add_dev+0x18a/0x1300 net/ipv6/addrconf.c:384
 addrconf_notify+0xc04/0x21c0 net/ipv6/addrconf.c:3380
 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/0x60 net/core/dev.c:1696
 call_netdevice_notifiers net/core/dev.c:1714 [inline]
 register_netdevice+0xd2a/0x1010 net/core/dev.c:7802
 register_netdev+0x1a/0x30 net/core/dev.c:7887
 sit_init_net+0x384/0xa30 net/ipv6/sit.c:1845
 ops_init+0x10a/0x570 net/core/net_namespace.c:118
 setup_net+0x313/0x710 net/core/net_namespace.c:295
 copy_net_ns+0x27c/0x580 net/core/net_namespace.c:419
 create_new_namespaces+0x425/0x880 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xae/0x1e0 kernel/nsproxy.c:206
 SYSC_unshare kernel/fork.c:2414 [inline]
 SyS_unshare+0x653/0xfa0 kernel/fork.c:2364
 entry_SYSCALL_64_fastpath+0x1f/0x96

Freed by task 1697:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3489 [inline]
 kfree+0xd6/0x260 mm/slab.c:3804
 skb_free_head+0x74/0xb0 net/core/skbuff.c:550
 skb_release_data+0x58c/0x790 net/core/skbuff.c:570
 skb_release_all+0x4a/0x60 net/core/skbuff.c:627
 __kfree_skb net/core/skbuff.c:641 [inline]
 kfree_skb+0x15d/0x4c0 net/core/skbuff.c:659
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x58d/0x6a0 net/netlink/af_netlink.c:1334
 netlink_sendmsg+0xa4a/0xe60 net/netlink/af_netlink.c:1897
 sock_sendmsg_nosec net/socket.c:628 [inline]
 sock_sendmsg+0xca/0x110 net/socket.c:638
 ___sys_sendmsg+0x767/0x8b0 net/socket.c:2018
 __sys_sendmsg+0xe5/0x210 net/socket.c:2052
 SYSC_sendmsg net/socket.c:2063 [inline]
 SyS_sendmsg+0x2d/0x50 net/socket.c:2059
 entry_SYSCALL_64_fastpath+0x1f/0x96

The buggy address belongs to the object at ffff8801c3deb240
 which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 8 bytes inside of
 1024-byte region [ffff8801c3deb240, ffff8801c3deb640)
The buggy address belongs to the page:
page:00000000c51f2b19 count:1 mapcount:0 mapping:00000000ac56ea00 index:0xffff8801c3debb40 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffff8801c3dea040 ffff8801c3debb40 0000000100000006
raw: ffffea0006d81920 ffffea0007516420 ffff8801dac00ac0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c3deb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801c3deb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801c3deb200: fb fb fb fb fb fb fb fb fb fb fb fb 00 00 00 00
                                              ^
 ffff8801c3deb280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801c3deb300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/12/31 12:51 linux-next 0e08c463db38 00193447 .config console log report ci-upstream-next-kasan-gce
* Struck through repros no longer work on HEAD.