KASAN: use-after-free Read in bpf_clone_redirect

10 views
Skip to first unread message

syzbot

unread,
Aug 17, 2019, 12:51:07 AM8/17/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 45f092f9 Linux 4.14.139
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=172cc89c600000
kernel config: https://syzkaller.appspot.com/x/.config?x=56ab4cf14cc8892d
dashboard link: https://syzkaller.appspot.com/bug?extid=41771c29517985192f14
compiler: gcc (GCC) 9.0.0 20181231 (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+41771c...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in ____bpf_clone_redirect net/core/filter.c:1768
[inline]
BUG: KASAN: use-after-free in bpf_clone_redirect+0x2de/0x2f0
net/core/filter.c:1759
Read of size 8 at addr ffff888091e62250 by task syz-executor.3/16424

CPU: 0 PID: 16424 Comm: syz-executor.3 Not tainted 4.14.139 #35
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x19c lib/dump_stack.c:53
print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
____bpf_clone_redirect net/core/filter.c:1768 [inline]
bpf_clone_redirect+0x2de/0x2f0 net/core/filter.c:1759
bpf_prog_71e1d56bce5f38ff+0x4c8/0x1000

Allocated by task 3527:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc mm/kasan/kasan.c:551 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:489
kmem_cache_alloc_node+0x144/0x780 mm/slab.c:3642
__alloc_skb+0x9c/0x500 net/core/skbuff.c:193
alloc_skb include/linux/skbuff.h:980 [inline]
kobject_uevent_env+0x781/0xc23 lib/kobject_uevent.c:479
kobject_synth_uevent.cold+0x7d/0xcd lib/kobject_uevent.c:205
uevent_store+0x26/0x70 drivers/base/core.c:996
dev_attr_store+0x59/0x80 drivers/base/core.c:714
sysfs_kf_write+0x10c/0x160 fs/sysfs/file.c:141
kernfs_fop_write+0x291/0x450 fs/kernfs/file.c:316
__vfs_write+0x105/0x6b0 fs/read_write.c:480
vfs_write+0x198/0x500 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xfd/0x230 fs/read_write.c:582
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 3527:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kmem_cache_free+0x83/0x2b0 mm/slab.c:3758
kfree_skbmem net/core/skbuff.c:586 [inline]
kfree_skbmem+0xac/0x120 net/core/skbuff.c:580
__kfree_skb net/core/skbuff.c:646 [inline]
consume_skb+0xb7/0x340 net/core/skbuff.c:705
netlink_broadcast_filtered+0x2ae/0x9f0 net/netlink/af_netlink.c:1488
kobject_uevent_env+0x8da/0xc23 lib/kobject_uevent.c:495
kobject_synth_uevent.cold+0x7d/0xcd lib/kobject_uevent.c:205
uevent_store+0x26/0x70 drivers/base/core.c:996
dev_attr_store+0x59/0x80 drivers/base/core.c:714
sysfs_kf_write+0x10c/0x160 fs/sysfs/file.c:141
kernfs_fop_write+0x291/0x450 fs/kernfs/file.c:316
__vfs_write+0x105/0x6b0 fs/read_write.c:480
vfs_write+0x198/0x500 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xfd/0x230 fs/read_write.c:582
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff888091e621c0
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 144 bytes inside of
232-byte region [ffff888091e621c0, ffff888091e622a8)
The buggy address belongs to the page:
page:ffffea0002479880 count:1 mapcount:0 mapping:ffff888091e62080
index:0xffff888091e62a80
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff888091e62080 ffff888091e62a80 0000000100000009
raw: ffffea000243e720 ffffea0002a6b220 ffff88821b719240 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888091e62100: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
ffff888091e62180: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
> ffff888091e62200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888091e62280: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
ffff888091e62300: 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,
Mar 20, 2020, 12:38:08 PM3/20/20
to syzkaller...@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