KASAN: use-after-free Write in skb_release_data

40 views
Skip to first unread message

syzbot

unread,
Jun 28, 2020, 8:59:13 PM6/28/20
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 54ec87ec ANDROID: GKI: Update whitelist and defconfig for ..
git tree: android-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=115c0755100000
kernel config: https://syzkaller.appspot.com/x/.config?x=da341116d697c80c
dashboard link: https://syzkaller.appspot.com/bug?extid=5ec5469fcf21c46a6400
compiler: Android (6032204 based on r370808) clang version 10.0.1 (https://android.googlesource.com/toolchain/llvm-project 6e765c10313d15c02ab29977a82938f66742c3a9)

Unfortunately, I don't have any reproducer for this crash yet.

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

==================================================================
BUG: KASAN: use-after-free in atomic_sub_return include/asm-generic/atomic-instrumented.h:159 [inline]
BUG: KASAN: use-after-free in skb_release_data+0xe5/0x6f0 net/core/skbuff.c:600
Write of size 4 at addr ffff8881a5c3d8e0 by task syz-executor.0/21764

CPU: 0 PID: 21764 Comm: syz-executor.0 Not tainted 5.4.49-syzkaller-00898-g54ec87ec7a59 #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+0x14a/0x1ce lib/dump_stack.c:118
print_address_description+0x93/0x620 mm/kasan/report.c:374
__kasan_report+0x16d/0x1e0 mm/kasan/report.c:506
kasan_report+0x36/0x60 mm/kasan/common.c:634
check_memory_region_inline mm/kasan/generic.c:181 [inline]
check_memory_region+0x2b5/0x2f0 mm/kasan/generic.c:191
atomic_sub_return include/asm-generic/atomic-instrumented.h:159 [inline]
skb_release_data+0xe5/0x6f0 net/core/skbuff.c:600
skb_release_all net/core/skbuff.c:665 [inline]
__kfree_skb+0x55/0x180 net/core/skbuff.c:679
sit_tunnel_xmit+0x443/0x24d0 net/ipv6/sit.c:1054
__netdev_start_xmit include/linux/netdevice.h:4467 [inline]
netdev_start_xmit include/linux/netdevice.h:4481 [inline]
xmit_one+0x219/0x460 net/core/dev.c:3196
dev_hard_start_xmit net/core/dev.c:3212 [inline]
__dev_queue_xmit+0x18d9/0x2680 net/core/dev.c:3771
packet_sendmsg_spkt+0x10a8/0x1730 net/packet/af_packet.c:1991
sock_sendmsg_nosec net/socket.c:638 [inline]
sock_sendmsg net/socket.c:658 [inline]
____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
___sys_sendmsg net/socket.c:2352 [inline]
__sys_sendmmsg+0x3b0/0x730 net/socket.c:2455
__do_sys_sendmmsg net/socket.c:2484 [inline]
__se_sys_sendmmsg net/socket.c:2481 [inline]
__x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45cb19
Code: 0d b7 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 b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fb8fd411c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00000000004fd680 RCX: 000000000045cb19
RDX: 0000000000000001 RSI: 0000000020003700 RDI: 0000000000000003
RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000902 R14: 00000000004cbde8 R15: 00007fb8fd4126d4

Allocated by task 21764:
save_stack mm/kasan/common.c:69 [inline]
set_track mm/kasan/common.c:77 [inline]
__kasan_kmalloc+0x12c/0x1c0 mm/kasan/common.c:510
slab_post_alloc_hook mm/slab.h:584 [inline]
slab_alloc_node mm/slub.c:2766 [inline]
slab_alloc mm/slub.c:2774 [inline]
__kmalloc_track_caller+0x201/0x2c0 mm/slub.c:4353
__kmalloc_reserve net/core/skbuff.c:141 [inline]
__alloc_skb+0xd1/0x4d0 net/core/skbuff.c:209
alloc_skb include/linux/skbuff.h:1055 [inline]
sock_wmalloc+0xaa/0x3d0 net/core/sock.c:2098
packet_sendmsg_spkt+0x3f8/0x1730 net/packet/af_packet.c:1938
sock_sendmsg_nosec net/socket.c:638 [inline]
sock_sendmsg net/socket.c:658 [inline]
____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
___sys_sendmsg net/socket.c:2352 [inline]
__sys_sendmmsg+0x3b0/0x730 net/socket.c:2455
__do_sys_sendmmsg net/socket.c:2484 [inline]
__se_sys_sendmmsg net/socket.c:2481 [inline]
__x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 21764:
save_stack mm/kasan/common.c:69 [inline]
set_track mm/kasan/common.c:77 [inline]
kasan_set_free_info mm/kasan/common.c:332 [inline]
__kasan_slab_free+0x181/0x230 mm/kasan/common.c:471
slab_free_hook mm/slub.c:1424 [inline]
slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1457
slab_free mm/slub.c:3014 [inline]
kfree+0x12b/0x600 mm/slub.c:3975
skb_release_all net/core/skbuff.c:665 [inline]
__kfree_skb+0x55/0x180 net/core/skbuff.c:679
packet_rcv+0x151/0x1410 net/packet/af_packet.c:2153
dev_queue_xmit_nit+0x946/0x9e0 net/core/dev.c:1991
xmit_one+0x7b/0x460 net/core/dev.c:3192
dev_hard_start_xmit net/core/dev.c:3212 [inline]
__dev_queue_xmit+0x18d9/0x2680 net/core/dev.c:3771
packet_sendmsg_spkt+0x10a8/0x1730 net/packet/af_packet.c:1991
sock_sendmsg_nosec net/socket.c:638 [inline]
sock_sendmsg net/socket.c:658 [inline]
____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
___sys_sendmsg net/socket.c:2352 [inline]
__sys_sendmmsg+0x3b0/0x730 net/socket.c:2455
__do_sys_sendmmsg net/socket.c:2484 [inline]
__se_sys_sendmmsg net/socket.c:2481 [inline]
__x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2481
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff8881a5c3d800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 224 bytes inside of
512-byte region [ffff8881a5c3d800, ffff8881a5c3da00)
The buggy address belongs to the page:
page:ffffea0006970f00 refcount:1 mapcount:0 mapping:ffff8881da802500 index:0xffff8881a5c3f000 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 ffffea0006a39700 0000000700000007 ffff8881da802500
raw: ffff8881a5c3f000 000000008010000e 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881a5c3d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881a5c3d800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881a5c3d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881a5c3d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881a5c3d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Nov 26, 2020, 4:03:15 PM11/26/20
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages