syzbot


KASAN: use-after-free Read in _decode_session6

Status: auto-closed as invalid on 2020/09/21 07:45
Reported-by: syzbot+c86525c19cda18dd8c5a@syzkaller.appspotmail.com
First crash: 1441d, last: 1432d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Read in _decode_session6 23 856d 1510d 0/1 auto-closed as invalid on 2022/04/20 21:31
linux-4.19 KASAN: use-after-free Read in _decode_session6 (2) 1 708d 708d 0/1 auto-obsoleted due to no activity on 2022/09/15 14:44
linux-4.19 KASAN: use-after-free Read in _decode_session6 2 1401d 1433d 0/1 auto-closed as invalid on 2020/10/22 17:34
android-414 KASAN: use-after-free Read in _decode_session6 1 2051d 2051d 0/1 auto-closed as invalid on 2019/03/12 14:41
upstream KASAN: use-after-free Read in _decode_session6 net C done 4 1990d 2058d 13/26 fixed on 2019/11/07 18:45

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in _decode_session6+0xe0a/0x1250 net/ipv6/xfrm6_policy.c:136
Read of size 1 at addr ffff88808c192ff0 by task syz-executor.2/24536

CPU: 1 PID: 24536 Comm: syz-executor.2 Not tainted 4.14.181-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+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1dc 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/0x2b9 mm/kasan/report.c:393
 _decode_session6+0xe0a/0x1250 net/ipv6/xfrm6_policy.c:136
 __xfrm_decode_session+0x5a/0x110 net/xfrm/xfrm_policy.c:2247
 xfrm_decode_session_reverse include/net/xfrm.h:1181 [inline]
 icmpv6_route_lookup+0x27a/0x3c0 net/ipv6/icmp.c:375
 icmp6_send+0x1162/0x1ee0 net/ipv6/icmp.c:556
 icmpv6_send+0xa6/0x1a0 net/ipv6/ip6_icmp.c:43
 ip6_link_failure+0x24/0x410 net/ipv6/route.c:1440
 dst_link_failure include/net/dst.h:445 [inline]
 ip6_tnl_xmit+0x3dd/0x2ee0 net/ipv6/ip6_tunnel.c:1221
 ip6ip6_tnl_xmit net/ipv6/ip6_tunnel.c:1380 [inline]
 ip6_tnl_start_xmit+0x73f/0x1ae0 net/ipv6/ip6_tunnel.c:1403
 __netdev_start_xmit include/linux/netdevice.h:4039 [inline]
 netdev_start_xmit include/linux/netdevice.h:4048 [inline]
 xmit_one net/core/dev.c:3009 [inline]
 dev_hard_start_xmit+0x186/0x880 net/core/dev.c:3025
 sch_direct_xmit+0x256/0x4f0 net/sched/sch_generic.c:186
 qdisc_restart net/sched/sch_generic.c:249 [inline]
 __qdisc_run+0x24e/0xdb0 net/sched/sch_generic.c:257
 __dev_xmit_skb net/core/dev.c:3235 [inline]
 __dev_queue_xmit+0x1558/0x25a0 net/core/dev.c:3493
 neigh_output include/net/neighbour.h:500 [inline]
 ip6_finish_output2+0x1114/0x21b0 net/ipv6/ip6_output.c:120
 ip6_finish_output+0x702/0xaf0 net/ipv6/ip6_output.c:154
 NF_HOOK_COND include/linux/netfilter.h:239 [inline]
 ip6_output+0x1c5/0x660 net/ipv6/ip6_output.c:171
 dst_output include/net/dst.h:462 [inline]
 ip6_local_out+0x93/0x170 net/ipv6/output_core.c:178
 ip6_send_skb+0x9b/0x2f0 net/ipv6/ip6_output.c:1688
 udp_v6_send_skb+0x4e8/0xe80 net/ipv6/udp.c:1081
 udp_v6_push_pending_frames+0x211/0x310 net/ipv6/udp.c:1114
 udpv6_sendmsg+0x1a1b/0x2610 net/ipv6/udp.c:1380
 inet_sendmsg+0x116/0x4d0 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x70a/0x840 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45ca29
RSP: 002b:00007fa597fbdc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000500d00 RCX: 000000000045ca29
RDX: 0000000000000000 RSI: 0000000020000340 RDI: 0000000000000003
RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000009fb R14: 00000000004ccd39 R15: 00007fa597fbe6d4

Allocated by task 3644:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551
 kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
 getname_flags+0xc8/0x550 fs/namei.c:138
 user_path_at_empty+0x2a/0x50 fs/namei.c:2631
 user_path_at include/linux/namei.h:57 [inline]
 SYSC_faccessat fs/open.c:403 [inline]
 SyS_faccessat+0x21b/0x680 fs/open.c:353
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 3644:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xaf/0x190 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758
 putname+0xcd/0x110 fs/namei.c:259
 filename_lookup+0x23a/0x380 fs/namei.c:2386
 user_path_at include/linux/namei.h:57 [inline]
 SYSC_faccessat fs/open.c:403 [inline]
 SyS_faccessat+0x21b/0x680 fs/open.c:353
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff88808c192300
 which belongs to the cache names_cache of size 4096
The buggy address is located 3312 bytes inside of
 4096-byte region [ffff88808c192300, ffff88808c193300)
The buggy address belongs to the page:
page:ffffea0002306480 count:1 mapcount:0 mapping:ffff88808c192300 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff88808c192300 0000000000000000 0000000100000001
raw: ffffea0002120620 ffffea00023fba20 ffff8880aa9dacc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808c192e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808c192f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88808c192f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
 ffff88808c193000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808c193080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/05/24 07:44 linux-4.14.y a41ba30d9df2 96c92ad3 .config console log report ci2-linux-4-14
2020/05/15 13:17 linux-4.14.y ab9dfda23248 d7f9fffa .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.