syzbot


KASAN: use-after-free Read in ipv6_skip_exthdr (2)

Status: closed as invalid on 2023/12/05 18:25
Subsystems: net
[Documentation on labels]
First crash: 700d, last: 700d
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ipv6_skip_exthdr net 19 2 818d 859d 0/29 auto-obsoleted due to no activity on 2023/09/17 14:22

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ipv6_skip_exthdr+0x481/0x4c0 net/ipv6/exthdrs_core.c:103
Read of size 1 at addr ffff8881a29b0011 by task syz-executor.4/1545

CPU: 1 PID: 1545 Comm: syz-executor.4 Not tainted 6.6.0-rc2-syzkaller-00644-ge9cbc89067cc #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xc4/0x620 mm/kasan/report.c:475
 kasan_report+0xda/0x110 mm/kasan/report.c:588
 ipv6_skip_exthdr+0x481/0x4c0 net/ipv6/exthdrs_core.c:103
 ipv6_get_l4proto net/netfilter/nf_conntrack_core.c:387 [inline]
 get_l4proto+0x34b/0x520 net/netfilter/nf_conntrack_core.c:410
 nf_conntrack_in+0x1e3/0x1850 net/netfilter/nf_conntrack_core.c:1977
 nf_hook_entry_hookfn include/linux/netfilter.h:144 [inline]
 nf_hook_slow+0xbf/0x1e0 net/netfilter/core.c:626
 nf_hook include/linux/netfilter.h:259 [inline]
 __ip6_local_out+0x431/0x900 net/ipv6/output_core.c:143
 ip6_local_out+0x2a/0x190 net/ipv6/output_core.c:153
 ip6_send_skb+0xb7/0x330 net/ipv6/ip6_output.c:2017
 udp_v6_send_skb+0x9a6/0x1910 net/ipv6/udp.c:1284
 udpv6_sendmsg+0x2482/0x2f00 net/ipv6/udp.c:1578
 inet6_sendmsg+0x9d/0xe0 net/ipv6/af_inet6.c:656
 sock_sendmsg_nosec net/socket.c:730 [inline]
 sock_sendmsg+0xd9/0x180 net/socket.c:753
 __sys_sendto+0x255/0x340 net/socket.c:2177
 __do_sys_sendto net/socket.c:2189 [inline]
 __se_sys_sendto net/socket.c:2185 [inline]
 __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2185
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f45e367cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f45e44190c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007f45e379bf80 RCX: 00007f45e367cae9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007f45e36c847a R08: 00000000200001c0 R09: 000000000000001c
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f45e379bf80 R15: 00007fff3d6ea9b8
 </TASK>

The buggy address belongs to the physical page:
page:ffffea00068a6c00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a29b0
flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 057ff00000000000 ffffea00068a6c08 ffffea00068a6c08 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner info is not present (never set?)

Memory state around the buggy address:
 ffff8881a29aff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881a29aff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881a29b0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                         ^
 ffff8881a29b0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881a29b0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/22 06:34 net-next e9cbc89067cc 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: use-after-free Read in ipv6_skip_exthdr
* Struck through repros no longer work on HEAD.