KASAN: slab-out-of-bounds Read in ipvlan_queue_xmit

8 views
Skip to first unread message

syzbot

unread,
Aug 30, 2022, 9:48:29 AM8/30/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e548869f356f Linux 4.14.291
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13f0a89d080000
kernel config: https://syzkaller.appspot.com/x/.config?x=14f65e3c6215eb84
dashboard link: https://syzkaller.appspot.com/bug?extid=ec1a3196612411080dbc
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=124ee98b080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=133b3a8b080000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ec1a31...@syzkaller.appspotmail.com

IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready
batman_adv: batadv0: Interface activated: batadv_slave_1
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
==================================================================
BUG: KASAN: slab-out-of-bounds in ether_addr_equal include/linux/etherdevice.h:321 [inline]
BUG: KASAN: slab-out-of-bounds in ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:542 [inline]
BUG: KASAN: slab-out-of-bounds in ipvlan_queue_xmit+0x1323/0x15a0 drivers/net/ipvlan/ipvlan_core.c:583
Read of size 4 at addr ffff8880b024dc7f by task syz-executor308/7955

CPU: 1 PID: 7955 Comm: syz-executor308 Not tainted 4.14.291-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
ether_addr_equal include/linux/etherdevice.h:321 [inline]
ipvlan_xmit_mode_l2 drivers/net/ipvlan/ipvlan_core.c:542 [inline]
ipvlan_queue_xmit+0x1323/0x15a0 drivers/net/ipvlan/ipvlan_core.c:583
ipvlan_start_xmit+0x4f/0x180 drivers/net/ipvlan/ipvlan_main.c:286
__netdev_start_xmit include/linux/netdevice.h:4054 [inline]
netdev_start_xmit include/linux/netdevice.h:4063 [inline]
packet_direct_xmit+0x410/0x610 net/packet/af_packet.c:269
packet_snd+0x13aa/0x26f0 net/packet/af_packet.c:3032
packet_sendmsg+0x12ed/0x33a0 net/packet/af_packet.c:3061
sock_sendmsg_nosec net/socket.c:646 [inline]
sock_sendmsg+0xb5/0x100 net/socket.c:656
SYSC_sendto net/socket.c:1763 [inline]
SyS_sendto+0x1c7/0x2c0 net/socket.c:1731
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f66a6a59d79
RSP: 002b:00007ffcdf89c728 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007ffcdf89c748 RCX: 00007f66a6a59d79
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 0000000000000003 R08: 00000000200000c0 R09: 0000000000000014
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcdf89c770
R13: 00007ffcdf89c770 R14: 00007f66a6a9c3be R15: 00007ffcdf89c750

Allocated by task 6222:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
getname_flags+0xc8/0x550 fs/namei.c:138
getname fs/namei.c:209 [inline]
SYSC_renameat2 fs/namei.c:4571 [inline]
SyS_renameat2+0x17b/0xad0 fs/namei.c:4535
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 6222:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758
putname+0xcd/0x110 fs/namei.c:259
SYSC_renameat2 fs/namei.c:4665 [inline]
SyS_renameat2+0x214/0xad0 fs/namei.c:4535
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880b024c340
which belongs to the cache names_cache of size 4096
The buggy address is located 2367 bytes to the right of
4096-byte region [ffff8880b024c340, ffff8880b024d340)
The buggy address belongs to the page:
page:ffffea0002c09300 count:1 mapcount:0 mapping:ffff8880b024c340 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff8880b024c340 0000000000000000 0000000100000001
raw: ffffea0002cd0c20 ffffea0002bd3020 ffff88823f8c1200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880b024db00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880b024db80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880b024dc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8880b024dc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880b024dd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages