KASAN: use-after-free Read in bpf_skb_change_tail

6 views
Skip to first unread message

syzbot

unread,
Apr 13, 2019, 8:02:22 PM4/13/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 8c958cd7 ANDROID: sdcardfs: Change current->fs under lock
git tree: android-4.14
console output: https://syzkaller.appspot.com/x/log.txt?x=15a8aa31400000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b3b342f97278cde
dashboard link: https://syzkaller.appspot.com/bug?extid=470a78a8e4bedc40d1b1
compiler: gcc (GCC) 8.0.1 20180413 (experimental)

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+470a78...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in ____bpf_skb_change_tail
net/core/filter.c:2370 [inline]
BUG: KASAN: use-after-free in bpf_skb_change_tail+0xa2c/0xb90
net/core/filter.c:2367
Read of size 8 at addr ffff8801cf84d590 by task syz-executor0/21320

CPU: 0 PID: 21320 Comm: syz-executor0 Not tainted 4.14.73+ #16
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0xb9/0x11b lib/dump_stack.c:53
print_address_description+0x60/0x22b mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409
____bpf_skb_change_tail net/core/filter.c:2370 [inline]
bpf_skb_change_tail+0xa2c/0xb90 net/core/filter.c:2367
___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012

Allocated by task 19710:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551
slab_post_alloc_hook mm/slab.h:442 [inline]
slab_alloc_node mm/slub.c:2723 [inline]
slab_alloc mm/slub.c:2731 [inline]
kmem_cache_alloc+0xe4/0x2b0 mm/slub.c:2736
skb_clone+0x120/0x300 net/core/skbuff.c:1278
tcp_v6_do_rcv+0xca8/0x1050 net/ipv6/tcp_ipv6.c:1286
sk_backlog_rcv include/net/sock.h:902 [inline]
__release_sock+0x135/0x350 net/core/sock.c:2261
release_sock+0x54/0x1b0 net/core/sock.c:2773
tcp_sendmsg+0x34/0x40 net/ipv4/tcp.c:1447
inet_sendmsg+0x168/0x540 net/ipv4/af_inet.c:781
sock_sendmsg_nosec net/socket.c:645 [inline]
sock_sendmsg+0xb5/0x100 net/socket.c:655
SYSC_sendto net/socket.c:1762 [inline]
SyS_sendto+0x211/0x340 net/socket.c:1730
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 19710:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524
slab_free_hook mm/slub.c:1389 [inline]
slab_free_freelist_hook mm/slub.c:1410 [inline]
slab_free mm/slub.c:2966 [inline]
kmem_cache_free+0x12d/0x350 mm/slub.c:2988
kfree_skbmem+0x9e/0x100 net/core/skbuff.c:582
tcp_v6_do_rcv+0xe53/0x1050 net/ipv6/tcp_ipv6.c:1369
sk_backlog_rcv include/net/sock.h:902 [inline]
__release_sock+0x135/0x350 net/core/sock.c:2261
release_sock+0x54/0x1b0 net/core/sock.c:2773
tcp_sendmsg+0x34/0x40 net/ipv4/tcp.c:1447
inet_sendmsg+0x168/0x540 net/ipv4/af_inet.c:781
sock_sendmsg_nosec net/socket.c:645 [inline]
sock_sendmsg+0xb5/0x100 net/socket.c:655
SYSC_sendto net/socket.c:1762 [inline]
SyS_sendto+0x211/0x340 net/socket.c:1730
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801cf84d500
which belongs to the cache skbuff_head_cache of size 224
The buggy address is located 144 bytes inside of
224-byte region [ffff8801cf84d500, ffff8801cf84d5e0)
The buggy address belongs to the page:
page:ffffea00073e1340 count:1 mapcount:0 mapping: (null)
index:0xffff8801cf84da00
flags: 0x4000000000000100(slab)
raw: 4000000000000100 0000000000000000 ffff8801cf84da00 00000001800c000b
raw: ffffea00070eddc0 0000000500000005 ffff8801d6770200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8801cf84d480: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
ffff8801cf84d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8801cf84d580: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
^
ffff8801cf84d600: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff8801cf84d680: 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,
May 18, 2019, 12:13:04 AM5/18/19
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