syzbot


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

Status: auto-closed as invalid on 2020/12/01 23:50
Subsystems: net
[Documentation on labels]
First crash: 1385d, last: 1385d
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 1568d 1568d 0/27 closed as invalid on 2020/05/30 17:14
linux-4.19 KASAN: use-after-free Read in ipvlan_queue_xmit (2) C error 2 659d 1128d 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 1283d 1283d 0/1 auto-closed as invalid on 2021/04/13 03:52
upstream KASAN: use-after-free Read in ipvlan_queue_xmit (3) net C error error 8 685d 1282d 22/27 fixed on 2023/02/24 13:51
linux-4.14 KASAN: use-after-free Read in ipvlan_queue_xmit C 2 486d 1313d 0/1 upstream: reported C repro on 2020/11/14 09:46

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ether_addr_equal include/linux/etherdevice.h:329 [inline]
BUG: KASAN: use-after-free in ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:599 [inline]
BUG: KASAN: use-after-free in ipvlan_queue_xmit+0x15ca/0x17e0 drivers/net/ipvlan/ipvlan_core.c:645
Read of size 4 at addr ffff888054ad07ff by task syz-executor.2/7958

CPU: 0 PID: 7958 Comm: syz-executor.2 Not tainted 5.9.0-rc1-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+0x18f/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 ether_addr_equal include/linux/etherdevice.h:329 [inline]
 ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:599 [inline]
 ipvlan_queue_xmit+0x15ca/0x17e0 drivers/net/ipvlan/ipvlan_core.c:645
 ipvlan_start_xmit+0x49/0x190 drivers/net/ipvlan/ipvlan_main.c:220
 __netdev_start_xmit include/linux/netdevice.h:4634 [inline]
 netdev_start_xmit include/linux/netdevice.h:4648 [inline]
 dev_direct_xmit+0x4e9/0x6e0 net/core/dev.c:4203
 packet_snd net/packet/af_packet.c:2984 [inline]
 packet_sendmsg+0x2413/0x5290 net/packet/af_packet.c:3009
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:671
 __sys_sendto+0x21c/0x320 net/socket.c:1992
 __do_sys_sendto net/socket.c:2004 [inline]
 __se_sys_sendto net/socket.c:2000 [inline]
 __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2000
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45d5b9
Code: 5d 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 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f008465ec78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 000000000002d180 RCX: 000000000045d5b9
RDX: 000000000000000e RSI: 0000000020000180 RDI: 0000000000000003
RBP: 000000000118cf98 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c
R13: 00007ffdcc6166bf R14: 00007f008465f9c0 R15: 000000000118cf4c

Allocated by task 7844:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
 kasan_set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461
 __do_kmalloc mm/slab.c:3655 [inline]
 __kmalloc+0x1a8/0x320 mm/slab.c:3664
 kmalloc include/linux/slab.h:559 [inline]
 tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x212/0x3f0 security/tomoyo/file.c:822
 tomoyo_path_symlink+0x94/0xe0 security/tomoyo/tomoyo.c:200
 security_path_symlink+0xdf/0x150 security/security.c:1109
 do_symlinkat+0x123/0x2c0 fs/namei.c:3984
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 7844:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56
 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355
 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422
 __cache_free mm/slab.c:3418 [inline]
 kfree+0x103/0x2c0 mm/slab.c:3756
 tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x212/0x3f0 security/tomoyo/file.c:822
 tomoyo_path_symlink+0x94/0xe0 security/tomoyo/tomoyo.c:200
 security_path_symlink+0xdf/0x150 security/security.c:1109
 do_symlinkat+0x123/0x2c0 fs/namei.c:3984
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff888054ad0000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 2047 bytes inside of
 4096-byte region [ffff888054ad0000, ffff888054ad1000)
The buggy address belongs to the page:
page:00000000ae77907f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x54ad0
head:00000000ae77907f order:1 compound_mapcount:0
flags: 0xfffe0000010200(slab|head)
raw: 00fffe0000010200 ffffea0002406888 ffffea000176eb08 ffff8880aa040900
raw: 0000000000000000 ffff888054ad0000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888054ad0680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888054ad0700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888054ad0780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff888054ad0800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888054ad0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/09/02 23:49 net-old 1996cf46e467 abf9ba4f .config console log report ci-upstream-net-this-kasan-gce
* Struck through repros no longer work on HEAD.