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

8 views
Skip to first unread message

syzbot

unread,
Oct 31, 2017, 6:44:06 AM10/31/17
to syzkaller-upst...@googlegroups.com
Hello,

syzkaller hit the following crash on
9829d9f31f6c0e4984545e03032f14ccca6eeb68
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.


CC: [linux-...@vger.kernel.org linux-...@vger.kernel.org
vi...@zeniv.linux.org.uk]

==================================================================
BUG: KASAN: slab-out-of-bounds in __list_del_entry_valid+0x10b/0x150
lib/list_debug.c:51
Read of size 8 at addr ffff88006975fa80 by task syz-executor4/13081

CPU: 3 PID: 13081 Comm: syz-executor4 Not tainted 4.13.0-next-20170904+ #14
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:52
print_address_description+0x73/0x250 mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report+0x24e/0x340 mm/kasan/report.c:409
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
__list_del_entry_valid+0x10b/0x150 lib/list_debug.c:51
__list_del_entry include/linux/list.h:116 [inline]
list_del include/linux/list.h:124 [inline]
__remove_wait_queue include/linux/wait.h:182 [inline]
userfaultfd_event_wait_completion+0x519/0x910 fs/userfaultfd.c:591
dup_fctx fs/userfaultfd.c:687 [inline]
dup_userfaultfd_complete+0x2de/0x480 fs/userfaultfd.c:695
dup_mmap kernel/fork.c:726 [inline]
dup_mm kernel/fork.c:1179 [inline]
copy_mm+0xe9b/0x1310 kernel/fork.c:1233
copy_process.part.36+0x1eae/0x4af0 kernel/fork.c:1735
copy_process kernel/fork.c:1548 [inline]
_do_fork+0x1ef/0xfe0 kernel/fork.c:2027
SYSC_clone kernel/fork.c:2137 [inline]
SyS_clone+0x37/0x50 kernel/fork.c:2131
do_syscall_64+0x26c/0x8c0 arch/x86/entry/common.c:287
entry_SYSCALL64_slow_path+0x25/0x25
RIP: 0033:0x447299
RSP: 002b:00007f6f41b81c08 EFLAGS: 00000282 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000447299
RDX: 0000000020d6f000 RSI: 0000000020d42fff RDI: 0000000000000000
RBP: 0000000000708160 R08: 0000000020497000 R09: 0000000000000000
R10: 0000000020a6bffc R11: 0000000000000282 R12: 00000000ffffffff
R13: 0000000000000450 R14: 00000000006e3510 R15: 0000000020d42fff

Allocated by task 13101:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3627
kmalloc include/linux/slab.h:493 [inline]
perf_event_mmap_event kernel/events/core.c:6943 [inline]
perf_event_mmap+0x4b2/0x1170 kernel/events/core.c:7137
mmap_region+0x3e5/0x15a0 mm/mmap.c:1721
do_mmap+0x6a1/0xd50 mm/mmap.c:1468
do_mmap_pgoff include/linux/mm.h:2151 [inline]
vm_mmap_pgoff+0x1de/0x280 mm/util.c:333
vm_mmap+0x6a/0x90 mm/util.c:352
elf_map+0x1c7/0x230 fs/binfmt_elf.c:373
load_elf_binary+0xc17/0x4970 fs/binfmt_elf.c:989
search_binary_handler+0x142/0x6b0 fs/exec.c:1652
exec_binprm fs/exec.c:1694 [inline]
do_execveat_common.isra.33+0x1746/0x22e0 fs/exec.c:1816
do_execve+0x31/0x40 fs/exec.c:1860
call_usermodehelper_exec_async+0x457/0x8f0 kernel/umh.c:100
ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

Freed by task 13101:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3503 [inline]
kfree+0xca/0x250 mm/slab.c:3820
perf_event_mmap_event kernel/events/core.c:7023 [inline]
perf_event_mmap+0xa0d/0x1170 kernel/events/core.c:7137
mmap_region+0x3e5/0x15a0 mm/mmap.c:1721
do_mmap+0x6a1/0xd50 mm/mmap.c:1468
do_mmap_pgoff include/linux/mm.h:2151 [inline]
vm_mmap_pgoff+0x1de/0x280 mm/util.c:333
vm_mmap+0x6a/0x90 mm/util.c:352
elf_map+0x1c7/0x230 fs/binfmt_elf.c:373
load_elf_binary+0xc17/0x4970 fs/binfmt_elf.c:989
search_binary_handler+0x142/0x6b0 fs/exec.c:1652
exec_binprm fs/exec.c:1694 [inline]
do_execveat_common.isra.33+0x1746/0x22e0 fs/exec.c:1816
do_execve+0x31/0x40 fs/exec.c:1860
call_usermodehelper_exec_async+0x457/0x8f0 kernel/umh.c:100
ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

The buggy address belongs to the object at ffff88006975e180
which belongs to the cache kmalloc-4096 of size 4096
The buggy address is located 2304 bytes to the right of
4096-byte region [ffff88006975e180, ffff88006975f180)
The buggy address belongs to the page:
page:ffffea0001a5d780 count:1 mapcount:0 mapping:ffff88006975e180 index:0x0
compound_mapcount: 0
flags: 0x500000000008100(slab|head)
raw: 0500000000008100 ffff88006975e180 0000000000000000 0000000100000001
raw: ffffea0001a5d720 ffffea000168d020 ffff88003e800dc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88006975f980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88006975fa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff88006975fa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88006975fb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88006975fb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.
Please credit me with: Reported-by: syzbot

syzbot will keep track of this bug report.
Once a fix for this bug is committed, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line.
To upstream this report, please reply with:
#syz upstream
config.txt
raw.log

Dmitry Vyukov

unread,
Dec 6, 2017, 7:53:05 AM12/6/17
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
Happened once 3 months ago

#syz invalid

On Tue, Oct 31, 2017 at 11:44 AM, syzbot
<bot+9e17bf11ccb8a8b0a3...@syzkaller.appspotmail.com>
wrote:
> --
> You received this message because you are subscribed to the Google Groups
> "syzkaller-upstream-moderation" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to syzkaller-upstream-m...@googlegroups.com.
> To post to this group, send email to
> syzkaller-upst...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller-upstream-moderation/001a11448af4f989fb055cd56ee0%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages