KASAN: use-after-free Read in trailing_symlink

17 views
Skip to first unread message

syzbot

unread,
Apr 14, 2019, 4:52:15 AM4/14/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 6fd50f70 ANDROID: sched/walt: Fix the potential bad unlock..
git tree: android-4.14
console output: https://syzkaller.appspot.com/x/log.txt?x=1521b56cc00000
kernel config: https://syzkaller.appspot.com/x/.config?x=48d735e8b07df6fc
dashboard link: https://syzkaller.appspot.com/bug?extid=faadffa41cca7eb0aeac
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+faadff...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in get_link fs/namei.c:1118 [inline]
BUG: KASAN: use-after-free in trailing_symlink+0x6a7/0x760 fs/namei.c:2297
Read of size 1 at addr ffff88818be623a8 by task syz-executor.0/4369

CPU: 0 PID: 4369 Comm: syz-executor.0 Not tainted 4.14.103+ #19
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0xb9/0x10e lib/dump_stack.c:53
print_address_description+0x60/0x226 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+0x88/0x2a5 mm/kasan/report.c:393

Allocated by task 4369:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc.part.0+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]
__kmalloc_track_caller+0xf1/0x310 mm/slub.c:4288
kstrdup+0x36/0x70 mm/util.c:56
bpf_symlink+0x22/0x110 kernel/bpf/inode.c:200
vfs_symlink2+0x32a/0x560 fs/namei.c:4208
SYSC_symlinkat fs/namei.c:4241 [inline]
SyS_symlinkat+0x116/0x1e0 fs/namei.c:4221
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289

Freed by task 4381:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xb0/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]
kfree+0xf5/0x310 mm/slub.c:3897
bpf_evict_inode+0x102/0x130 kernel/bpf/inode.c:381
evict+0x2cb/0x5f0 fs/inode.c:554
iput_final fs/inode.c:1516 [inline]
iput fs/inode.c:1543 [inline]
iput+0x36f/0x8d0 fs/inode.c:1528
do_unlinkat+0x376/0x5e0 fs/namei.c:4150
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289

The buggy address belongs to the object at ffff88818be623a8
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
8-byte region [ffff88818be623a8, ffff88818be623b0)
The buggy address belongs to the page:
page:ffffea00062f9880 count:1 mapcount:0 mapping: (null) index:0x0
flags: 0x4000000000000100(slab)
raw: 4000000000000100 0000000000000000 0000000000000000 0000000180aa00aa
raw: ffffea00065d9600 0000000400000004 ffff8881da803c00 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88818be62280: fc fb fc fc fb fc fc 00 fc fc fb fc fc fb fc fc
ffff88818be62300: fb fc fc fb fc fc fb fc fc fb fc fc fb fc fc 00
> ffff88818be62380: fc fc fb fc fc fb fc fc fb fc fc fb fc fc fb fc
^
ffff88818be62400: fc fb fc fc fb fc fc fb fc fc fb fc fc fb fc fc
ffff88818be62480: fb fc fc fb fc fc fb fc fc fb fc fc fb fc fc 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,
Aug 24, 2019, 4:25:05 PM8/24/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