syzbot


KASAN: use-after-free Write in ipgre_header

Status: closed as invalid on 2023/02/17 17:35
Subsystems: net
[Documentation on labels]
First crash: 514d, last: 514d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Write in ipgre_header (2) net 1 276d 276d 0/26 closed as invalid on 2023/10/27 14:39
linux-4.14 KASAN: use-after-free Write in ipgre_header C error 1 601d 631d 0/1 upstream: reported C repro on 2022/08/04 21:58
android-54 BUG: unable to handle kernel paging request in ipgre_header C 1 20d 631d 0/2 upstream: reported C repro on 2022/08/04 21:53

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ipgre_header+0x3b9/0x3c0 net/ipv4/ip_gre.c:854
Write of size 2 at addr ffff88815adc0000 by task syz-executor.1/18945

CPU: 0 PID: 18945 Comm: syz-executor.1 Not tainted 6.1.0-rc5-syzkaller-00081-ge493bec343fa #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15e/0x45d mm/kasan/report.c:395
 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495
 ipgre_header+0x3b9/0x3c0 net/ipv4/ip_gre.c:854
 dev_hard_header include/linux/netdevice.h:3060 [inline]
 neigh_connected_output+0x360/0x520 net/core/neighbour.c:1595
 neigh_output include/net/neighbour.h:546 [inline]
 ip_finish_output2+0x78a/0x2180 net/ipv4/ip_output.c:228
 __ip_finish_output net/ipv4/ip_output.c:306 [inline]
 __ip_finish_output+0x396/0x650 net/ipv4/ip_output.c:288
 ip_finish_output+0x31/0x280 net/ipv4/ip_output.c:316
 NF_HOOK_COND include/linux/netfilter.h:291 [inline]
 ip_mc_output+0x21f/0x710 net/ipv4/ip_output.c:415
 dst_output include/net/dst.h:445 [inline]
 ip_local_out+0xb3/0x1a0 net/ipv4/ip_output.c:126
 iptunnel_xmit+0x67e/0x9f0 net/ipv4/ip_tunnel_core.c:82
 ip_tunnel_xmit+0x1443/0x3180 net/ipv4/ip_tunnel.c:813
 erspan_xmit+0x821/0x2830 net/ipv4/ip_gre.c:715
 __netdev_start_xmit include/linux/netdevice.h:4840 [inline]
 netdev_start_xmit include/linux/netdevice.h:4854 [inline]
 xmit_one net/core/dev.c:3590 [inline]
 dev_hard_start_xmit+0x1c2/0x990 net/core/dev.c:3606
 sch_direct_xmit+0x1a3/0xbe0 net/sched/sch_generic.c:342
 __dev_xmit_skb net/core/dev.c:3817 [inline]
 __dev_queue_xmit+0x1645/0x3ba0 net/core/dev.c:4222
 dev_queue_xmit include/linux/netdevice.h:3008 [inline]
 neigh_hh_output include/net/neighbour.h:530 [inline]
 neigh_output include/net/neighbour.h:544 [inline]
 ip_finish_output2+0x14e3/0x2180 net/ipv4/ip_output.c:228
 __ip_finish_output net/ipv4/ip_output.c:306 [inline]
 __ip_finish_output+0x396/0x650 net/ipv4/ip_output.c:288
 ip_finish_output+0x31/0x280 net/ipv4/ip_output.c:316
 NF_HOOK_COND include/linux/netfilter.h:291 [inline]
 ip_mc_output+0x21f/0x710 net/ipv4/ip_output.c:415
 dst_output include/net/dst.h:445 [inline]
 ip_local_out+0xb3/0x1a0 net/ipv4/ip_output.c:126
 iptunnel_xmit+0x67e/0x9f0 net/ipv4/ip_tunnel_core.c:82
 ip_tunnel_xmit+0x1443/0x3180 net/ipv4/ip_tunnel.c:813
 ipgre_xmit+0x6e4/0x900 net/ipv4/ip_gre.c:661
 __netdev_start_xmit include/linux/netdevice.h:4840 [inline]
 netdev_start_xmit include/linux/netdevice.h:4854 [inline]
 xmit_one net/core/dev.c:3590 [inline]
 dev_hard_start_xmit+0x1c2/0x990 net/core/dev.c:3606
 __dev_queue_xmit+0x2cdf/0x3ba0 net/core/dev.c:4256
 dev_queue_xmit include/linux/netdevice.h:3008 [inline]
 __bpf_tx_skb net/core/filter.c:2116 [inline]
 __bpf_redirect_no_mac net/core/filter.c:2141 [inline]
 __bpf_redirect+0x666/0xe40 net/core/filter.c:2164
 ____bpf_clone_redirect net/core/filter.c:2431 [inline]
 bpf_clone_redirect+0x2b2/0x420 net/core/filter.c:2403
 bpf_prog_bebbfe2050753572+0x5e/0x63
 bpf_dispatcher_nop_func include/linux/bpf.h:968 [inline]
 __bpf_prog_run include/linux/filter.h:600 [inline]
 bpf_prog_run include/linux/filter.h:607 [inline]
 bpf_test_run+0x381/0x9d0 net/bpf/test_run.c:402
 bpf_prog_test_run_skb+0xbaf/0x1e60 net/bpf/test_run.c:1183
 bpf_prog_test_run kernel/bpf/syscall.c:3630 [inline]
 __sys_bpf+0x1599/0x4f40 kernel/bpf/syscall.c:4983
 __do_sys_bpf kernel/bpf/syscall.c:5069 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5067 [inline]
 __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5067
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fefa8c8c0d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fefa99cd168 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fefa8dac050 RCX: 00007fefa8c8c0d9
RDX: 000000000000002c RSI: 0000000020000080 RDI: 000000000000000a
RBP: 00007fefa8ce7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc85c1b67f R14: 00007fefa99cd300 R15: 0000000000022000
 </TASK>

The buggy address belongs to the physical page:
page:ffffea00056b7000 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15adc0
flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff00000000000 ffffea00056b7008 ffffea00056b7008 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:
 ffff88815adbff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88815adbff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88815adc0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff88815adc0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88815adc0100: 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
2022/11/30 01:53 net-old e493bec343fa 05dc7993 .config console log report info ci-upstream-net-this-kasan-gce KASAN: use-after-free Write in ipgre_header
* Struck through repros no longer work on HEAD.