syzbot


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

Status: public: reported C repro on 2019/04/13 00:01
Reported-by: syzbot+6a24ddff1e286a1211f0@syzkaller.appspotmail.com
First crash: 2240d, last: 1834d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in perf_output_read C error 13 644d 1675d 0/1 upstream: reported C repro on 2020/05/02 11:43

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in perf_output_read_group kernel/events/core.c:5882 [inline]
BUG: KASAN: slab-out-of-bounds in perf_output_read+0xe58/0xfc0 kernel/events/core.c:5917
Read of size 8 at addr ffff8881c93e7f08 by task syz-executor358/2206

CPU: 0 PID: 2206 Comm: syz-executor358 Not tainted 4.14.129+ #11
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+0xae/0x2d5 mm/kasan/report.c:393

Allocated by task 2206:
 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
 kmem_cache_alloc_trace+0x126/0x310 mm/slub.c:2750
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 alloc_perf_context+0x44/0xe0 kernel/events/core.c:3864
 find_get_context.isra.0+0x119/0x550 kernel/events/core.c:3953
 SYSC_perf_event_open kernel/events/core.c:10160 [inline]
 SyS_perf_event_open+0x9d3/0x2530 kernel/events/core.c:9988
 do_syscall_64+0x19b/0x510 arch/x86/entry/common.c:292

Freed by task 668:
 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
 load_elf_binary+0x1bf2/0x4530 fs/binfmt_elf.c:1096
 search_binary_handler fs/exec.c:1638 [inline]
 search_binary_handler+0x13f/0x6d0 fs/exec.c:1616
 exec_binprm fs/exec.c:1680 [inline]
 do_execveat_common.isra.0+0xf5f/0x1c30 fs/exec.c:1802
 do_execve fs/exec.c:1847 [inline]
 SYSC_execve fs/exec.c:1928 [inline]
 SyS_execve+0x34/0x40 fs/exec.c:1923
 do_syscall_64+0x19b/0x510 arch/x86/entry/common.c:292

The buggy address belongs to the object at ffff8881c93e7b80
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 392 bytes to the right of
 512-byte region [ffff8881c93e7b80, ffff8881c93e7d80)
The buggy address belongs to the page:
page:ffffea000724f980 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 0000000000000000 0000000000000000 00000001800c000c
raw: ffffea0007242200 0000000900000009 ffff8881da802c00 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881c93e7e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881c93e7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881c93e7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff8881c93e7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881c93e8000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/27 10:21 android-4.14 93c338c2e7ba 7509bf36 .config console log report syz C ci-android-414-kasan-gce-root
2019/11/25 07:04 android-4.14 437a2a739c5f 598ca6c8 .config console log report ci-android-414-kasan-gce-root
2019/06/27 07:05 android-4.14 93c338c2e7ba 7509bf36 .config console log report ci-android-414-kasan-gce-root
2019/06/26 00:15 android-4.14 93c338c2e7ba 0a8d1a96 .config console log report ci-android-414-kasan-gce-root
2019/06/25 12:03 android-4.14 93c338c2e7ba 82c13b6b .config console log report ci-android-414-kasan-gce-root
2019/06/22 16:23 android-4.14 334aa9b115f3 34bf9440 .config console log report ci-android-414-kasan-gce-root
2019/06/14 21:24 android-4.14 4edd10cd8204 442206d7 .config console log report ci-android-414-kasan-gce-root
2019/06/04 03:45 android-4.14 50f99a65439b ce07a7ae .config console log report ci-android-414-kasan-gce-root
2019/06/03 22:40 android-4.14 50f99a65439b 63bf051f .config console log report ci-android-414-kasan-gce-root
2019/04/28 22:34 android-4.14 ffa22221c473 b617407b .config console log report ci-android-414-kasan-gce-root
2019/04/18 21:23 android-4.14 d9a62b438b48 b0e8efcb .config console log report ci-android-414-kasan-gce-root
2018/12/27 22:22 android-4.14 815e34f802d8 af317504 .config console log report ci-android-414-kasan-gce-root
2018/11/29 16:40 android-4.14 def7f5472612 4b6d14f2 .config console log report ci-android-414-kasan-gce-root
2018/11/23 19:53 android-4.14 ea91d158d712 eb9ed731 .config console log report ci-android-414-kasan-gce-root
2018/10/24 21:58 android-4.14 35a066ea5bf9 a8292de9 .config console log report ci-android-414-kasan-gce-root
2018/10/15 17:28 android-4.14 48091d94336e 8cd30605 .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.