syzbot


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

Status: auto-closed as invalid on 2019/06/15 17:46
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+90e033e65bf7256f2afb@syzkaller.appspotmail.com
First crash: 2192d, last: 2118d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: slab-out-of-bounds Read in perf_exclude_event 0 (1) 2018/12/29 06:34

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in perf_exclude_event+0x18b/0x1a0 kernel/events/core.c:7895
Read of size 8 at addr ffff8881b09cff90 by task syz-executor2/30277

CPU: 0 PID: 30277 Comm: syz-executor2 Not tainted 4.20.0-rc7+ #154
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x244/0x39d lib/dump_stack.c:113
 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 perf_exclude_event+0x18b/0x1a0 kernel/events/core.c:7895
 perf_swevent_hrtimer+0x28f/0x510 kernel/events/core.c:9153
 __run_hrtimer kernel/time/hrtimer.c:1398 [inline]
 __hrtimer_run_queues+0x41c/0x10d0 kernel/time/hrtimer.c:1460
 hrtimer_interrupt+0x313/0x780 kernel/time/hrtimer.c:1518
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1034 [inline]
 smp_apic_timer_interrupt+0x1a1/0x760 arch/x86/kernel/apic/apic.c:1059
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
 </IRQ>

Allocated by task 30091:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553
 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620
 kmalloc include/linux/slab.h:546 [inline]
 kzalloc include/linux/slab.h:741 [inline]
 kernfs_iop_get_link+0x6d/0x690 fs/kernfs/symlink.c:136
 get_link fs/namei.c:1084 [inline]
 trailing_symlink+0x779/0x970 fs/namei.c:2263
 path_openat+0xb58/0x5150 fs/namei.c:3536
 do_filp_open+0x255/0x380 fs/namei.c:3564
 do_sys_open+0x568/0x700 fs/open.c:1063
 __do_sys_open fs/open.c:1081 [inline]
 __se_sys_open fs/open.c:1076 [inline]
 __x64_sys_open+0x7e/0xc0 fs/open.c:1076
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 30091:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kfree+0xcf/0x230 mm/slab.c:3817
 kfree_link+0x15/0x20 fs/libfs.c:1105
 do_delayed_call include/linux/delayed_call.h:28 [inline]
 put_link fs/namei.c:883 [inline]
 step_into fs/namei.c:1772 [inline]
 do_last fs/namei.c:3383 [inline]
 path_openat+0x1ed3/0x5150 fs/namei.c:3534
 do_filp_open+0x255/0x380 fs/namei.c:3564
 do_sys_open+0x568/0x700 fs/open.c:1063
 __do_sys_open fs/open.c:1081 [inline]
 __se_sys_open fs/open.c:1076 [inline]
 __x64_sys_open+0x7e/0xc0 fs/open.c:1076
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8881b09ce080
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 3856 bytes to the right of
 4096-byte region [ffff8881b09ce080, ffff8881b09cf080)
The buggy address belongs to the page:
page:ffffea0006c27380 count:1 mapcount:0 mapping:ffff8881da800dc0 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000010200(slab|head)
raw: 02fffc0000010200 ffffea00070ee188 ffffea0006ff4d08 ffff8881da800dc0
raw: 0000000000000000 ffff8881b09ce080 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881b09cfe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881b09cff00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
>ffff8881b09cff80: fc fc fc fc fc fc fc fc fc fc fc f1 f1 f1 f1 00
                         ^
 ffff8881b09d0000: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881b09d0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/17 17:45 upstream 7566ec393f41 def91db3 .config console log report ci-upstream-kasan-gce-smack-root
2018/11/21 14:59 upstream c8ce94b8fe53 5d9a3924 .config console log report ci-upstream-kasan-gce-root
2018/11/26 21:28 linux-next 442b8cea2477 ac912200 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/14 07:50 linux-next 774ea0551a29 caf12900 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/10/04 19:28 linux-next 25bcda3e8b9f 8b311eaf .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.