syzbot


KASAN: use-after-free Read in ipvlan_queue_xmit (3)

Status: fixed on 2023/02/24 13:51
Subsystems: net
[Documentation on labels]
Fix commit: 81225b2ea161 ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header
First crash: 1229d, last: 631d
Cause bisection: failed (error log, bisect log)
  
Fix bisection: failed (error log, bisect log)
  
Similar bugs (11)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ipvlan_queue_xmit net 1 1514d 1514d 0/26 closed as invalid on 2020/05/30 17:14
upstream KASAN: use-after-free Read in ipvlan_queue_xmit (2) net 1 1332d 1332d 0/26 auto-closed as invalid on 2020/12/01 23:50
linux-4.19 KASAN: use-after-free Read in ipvlan_queue_xmit (2) C error 2 605d 1074d 0/1 upstream: reported C repro on 2021/05/18 15:37
linux-4.19 KASAN: use-after-free Read in ipvlan_queue_xmit 1 1230d 1230d 0/1 auto-closed as invalid on 2021/04/13 03:52
linux-4.14 KASAN: use-after-free Read in ipvlan_queue_xmit C 2 433d 1259d 0/1 upstream: reported C repro on 2020/11/14 09:46
linux-4.14 KASAN: slab-out-of-bounds Read in ipvlan_queue_xmit C error 1 605d 605d 0/1 upstream: reported C repro on 2022/08/30 13:48
upstream KASAN: slab-out-of-bounds Read in ipvlan_queue_xmit net C error error 8 790d 1267d 22/26 fixed on 2023/02/24 13:50
upstream Internal error in ipvlan_queue_xmit net 3 173d 205d 0/26 auto-obsoleted due to no activity on 2024/02/04 03:58
linux-4.19 KASAN: slab-out-of-bounds Read in ipvlan_queue_xmit C error 4 443d 1243d 0/1 upstream: reported C repro on 2020/11/30 08:36
upstream KMSAN: uninit-value in ipvlan_queue_xmit net C 2 606d 1188d 22/26 fixed on 2023/02/24 13:50
upstream KMSAN: uninit-value in ipvlan_queue_xmit (2) net C 2 48d 9d01h 2/26 upstream: reported C repro on 2024/04/18 07:05

Sample crash report:
BUG: KASAN: use-after-free in ether_addr_equal include/linux/etherdevice.h:349 [inline]
BUG: KASAN: use-after-free in ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:598 [inline]
BUG: KASAN: use-after-free in ipvlan_queue_xmit+0x1724/0x19c0 drivers/net/ipvlan/ipvlan_core.c:644
Read of size 4 at addr ffff8880295c4fff by task syz-executor248/3626

CPU: 1 PID: 3626 Comm: syz-executor248 Not tainted 5.19.0-syzkaller-02972-g200e340f2196 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313
 print_report mm/kasan/report.c:429 [inline]
 kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491
 ether_addr_equal include/linux/etherdevice.h:349 [inline]
 ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:598 [inline]
 ipvlan_queue_xmit+0x1724/0x19c0 drivers/net/ipvlan/ipvlan_core.c:644
 ipvlan_start_xmit+0x45/0x190 drivers/net/ipvlan/ipvlan_main.c:220
 __netdev_start_xmit include/linux/netdevice.h:4805 [inline]
 netdev_start_xmit include/linux/netdevice.h:4819 [inline]
 __dev_direct_xmit+0x500/0x730 net/core/dev.c:4311
 dev_direct_xmit include/linux/netdevice.h:3007 [inline]
 packet_direct_xmit+0x1b8/0x2c0 net/packet/af_packet.c:282
 packet_snd net/packet/af_packet.c:3073 [inline]
 packet_sendmsg+0x21cb/0x5550 net/packet/af_packet.c:3104
 sock_sendmsg_nosec net/socket.c:714 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:734
 __sys_sendto+0x236/0x340 net/socket.c:2120
 __do_sys_sendto net/socket.c:2132 [inline]
 __se_sys_sendto net/socket.c:2128 [inline]
 __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2128
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ff4343bf459
Code: 28 c3 e8 aa 15 00 00 66 2e 0f 1f 84 00 00 00 00 00 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:00007ffc883fbf58 EFLAGS: 00000212 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007ff434442e90 RCX: 00007ff4343bf459
RDX: 000000000000000e RSI: 0000000020000000 RDI: 0000000000000004
RBP: 0000000000000003 R08: 0000000000000000 R09: ffffffffffffff09
R10: 0000000000000000 R11: 0000000000000212 R12: 00007ffc883fbfb0
R13: 00007ffc883fbfc0 R14: 00007ffc883fbfe0 R15: 0000000000000003
 </TASK>

The buggy address belongs to the physical page:
page:ffffea0000a57100 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x295c4
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0000a57148 ffffea0000a570c8 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:
 ffff8880295c4e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880295c4f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880295c4f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                                ^
 ffff8880295c5000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880295c5080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/08/04 14:58 upstream 200e340f2196 1c9013ac .config console log report syz C ci-qemu-upstream KASAN: use-after-free Read in ipvlan_queue_xmit
2021/12/25 10:27 upstream b927dfc67d05 6caa12e4 .config console log report syz C ci-upstream-kasan-gce-root KASAN: use-after-free Read in ipvlan_queue_xmit
2021/06/27 00:56 upstream 625acffd7ae2 9d2ab5df .config console log report syz C ci-upstream-kasan-gce KASAN: use-after-free Read in ipvlan_queue_xmit
2021/04/09 14:56 upstream 4fa56ad0d12e 6a81331a .config console log report syz C ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in ipvlan_queue_xmit
2021/04/09 11:09 upstream 4fa56ad0d12e 6a81331a .config console log report syz C ci-upstream-kasan-gce-root KASAN: use-after-free Read in ipvlan_queue_xmit
2021/05/13 11:39 linux-next ec85c95b0c90 ed7d41c5 .config console log report syz C ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in ipvlan_queue_xmit
2020/12/15 00:48 upstream 2c85ebc57b3e 97183ed7 .config console log report syz C ci-upstream-kasan-gce
2022/02/28 10:51 upstream 52a025546731 45a13a73 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: use-after-free Read in ipvlan_queue_xmit
* Struck through repros no longer work on HEAD.