syzbot


KASAN: use-after-free Read in ipvlan_queue_xmit

Status: auto-closed as invalid on 2021/04/13 03:52
Reported-by: syzbot+22ab492ff26563d5331d@syzkaller.appspotmail.com
First crash: 1451d, last: 1451d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ipvlan_queue_xmit net 1 1735d 1735d 0/28 closed as invalid on 2020/05/30 17:14
upstream KASAN: use-after-free Read in ipvlan_queue_xmit (2) net 1 1553d 1553d 0/28 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 826d 1295d 0/1 upstream: reported C repro on 2021/05/18 15:37
upstream KASAN: use-after-free Read in ipvlan_queue_xmit (3) net C error error 8 852d 1450d 22/28 fixed on 2023/02/24 13:51
linux-4.14 KASAN: use-after-free Read in ipvlan_queue_xmit C 2 654d 1480d 0/1 upstream: reported C repro on 2020/11/14 09:46

Sample crash report:
nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based  firewall rule not found. Use the iptables CT target to attach helpers instead.
audit: type=1800 audit(1607917874.213:6683): pid=3376 uid=0 auid=0 ses=4 subj==unconfined op=collect_data cause=failed comm="syz-executor.4" name="bus" dev="sda1" ino=17013 res=0
==================================================================
BUG: KASAN: use-after-free in ether_addr_equal include/linux/etherdevice.h:321 [inline]
BUG: KASAN: use-after-free in ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:605 [inline]
BUG: KASAN: use-after-free in ipvlan_queue_xmit+0x9d2/0x18e0 drivers/net/ipvlan/ipvlan_core.c:651
Read of size 4 at addr ffff8880b37df2ff by task syz-executor.1/3406

CPU: 0 PID: 3406 Comm: syz-executor.1 Not tainted 4.19.163-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load4_noabort+0x88/0x90 mm/kasan/report.c:432
 ether_addr_equal include/linux/etherdevice.h:321 [inline]
 ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:605 [inline]
 ipvlan_queue_xmit+0x9d2/0x18e0 drivers/net/ipvlan/ipvlan_core.c:651
 ipvlan_start_xmit+0x4f/0x190 drivers/net/ipvlan/ipvlan_main.c:290
 __netdev_start_xmit include/linux/netdevice.h:4333 [inline]
 netdev_start_xmit include/linux/netdevice.h:4347 [inline]
 dev_direct_xmit+0x3f9/0x6d0 net/core/dev.c:3905
 packet_snd net/packet/af_packet.c:2988 [inline]
 packet_sendmsg+0x2474/0x6aff net/packet/af_packet.c:3013
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:632
 sock_write_iter+0x287/0x3c0 net/socket.c:901
 call_write_iter include/linux/fs.h:1821 [inline]
 aio_write+0x37f/0x5c0 fs/aio.c:1574
 __io_submit_one fs/aio.c:1858 [inline]
 io_submit_one+0xecd/0x20c0 fs/aio.c:1909
 __do_sys_io_submit fs/aio.c:1953 [inline]
 __se_sys_io_submit+0x11b/0x4a0 fs/aio.c:1924
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45e159
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f76a7296c68 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045e159
RDX: 0000000020000080 RSI: 0000000000000001 RDI: 00007f76a7276000
RBP: 000000000119c068 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119c034
R13: 00007ffe773c3caf R14: 00007f76a72979c0 R15: 000000000119c034

Allocated by task 8109:
 kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
 vm_area_dup kernel/fork.c:329 [inline]
 dup_mmap kernel/fork.c:489 [inline]
 dup_mm kernel/fork.c:1288 [inline]
 copy_mm kernel/fork.c:1344 [inline]
 copy_process.part.0+0x343d/0x8200 kernel/fork.c:1916
 copy_process kernel/fork.c:1713 [inline]
 _do_fork+0x22f/0xf30 kernel/fork.c:2228
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 3270:
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x7f/0x260 mm/slab.c:3765
 remove_vma+0x132/0x170 mm/mmap.c:180
 exit_mmap+0x359/0x530 mm/mmap.c:3104
 __mmput kernel/fork.c:1015 [inline]
 mmput+0x14e/0x4a0 kernel/fork.c:1036
 exit_mm kernel/exit.c:549 [inline]
 do_exit+0xaf0/0x2be0 kernel/exit.c:877
 do_group_exit+0x125/0x310 kernel/exit.c:993
 get_signal+0x3f2/0x1f70 kernel/signal.c:2589
 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:821
 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880b37df250
 which belongs to the cache vm_area_struct of size 200
The buggy address is located 175 bytes inside of
 200-byte region [ffff8880b37df250, ffff8880b37df318)
The buggy address belongs to the page:
page:ffffea0002cdf7c0 count:1 mapcount:0 mapping:ffff88823b833ac0 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea00013dac88 ffffea0002c12548 ffff88823b833ac0
raw: 0000000000000000 ffff8880b37df040 000000010000000f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880b37df180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880b37df200: 00 00 fc fc fc fc fc fc fc fc fb fb fb fb fb fb
>ffff8880b37df280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff8880b37df300: fb fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00
 ffff8880b37df380: 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
2020/12/14 03:51 linux-4.19.y 13d2ce42de8c 8f160dd5 .config console log report info ci2-linux-4-19
* Struck through repros no longer work on HEAD.