KASAN: use-after-free Read in process_preds

Status: closed as dup on 2018/05/04 05:38
Subsystems: trace
[Documentation on labels]
First crash: 2061d, last: 2025d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: slab-out-of-bounds Write in process_preds trace C 6020 1992d 2068d
Duplicate bugs (2)
duplicates (2):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
KASAN: slab-out-of-bounds Read in process_preds trace 20 1992d 2052d 0/25 closed as dup on 2018/04/27 15:18
BUG: unable to handle kernel paging request in process_preds trace C 28 1987d 2052d 0/25 closed as dup on 2018/04/27 15:18
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in process_preds 2 (3) 2018/05/04 05:37

Sample crash report:
syz-executor4[8330] is installing a program with bpf_probe_write_user helper that may corrupt user memory!
BUG: KASAN: use-after-free in predicate_parse kernel/trace/trace_events_filter.c:562 [inline]
BUG: KASAN: use-after-free in process_preds+0x1905/0x19d0 kernel/trace/trace_events_filter.c:1508
Read of size 4 at addr ffff8801c06bfff0 by task syz-executor6/8891

CPU: 0 PID: 8891 Comm: syz-executor6 Not tainted 4.17.0-rc4+ #20
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1b9/0x294 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
 predicate_parse kernel/trace/trace_events_filter.c:562 [inline]
 process_preds+0x1905/0x19d0 kernel/trace/trace_events_filter.c:1508
 create_filter+0x155/0x270 kernel/trace/trace_events_filter.c:1716
 ftrace_profile_set_filter+0x130/0x2e0 kernel/trace/trace_events_filter.c:2041
 perf_event_set_filter+0x248/0x1230 kernel/events/core.c:9079
 _perf_ioctl+0x84c/0x15e0 kernel/events/core.c:5059
 perf_ioctl+0x59/0x80 kernel/events/core.c:5110
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x1cf/0x16a0 fs/ioctl.c:684
 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:701
 __do_sys_ioctl fs/ioctl.c:708 [inline]
 __se_sys_ioctl fs/ioctl.c:706 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:706
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
RIP: 0033:0x455a09
RSP: 002b:00007fd04258ec68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fd04258f6d4 RCX: 0000000000455a09
RDX: 00000000200000c0 RSI: 0000000040082406 RDI: 0000000000000013
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000002bf R14: 00000000006f8288 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea000701afc0 count:0 mapcount:-127 mapping:0000000000000000 index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000000ffffff80
raw: ffffea00066903a0 ffffea000661f5a0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c06bfe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8801c06bff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8801c06bff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8801c06c0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801c06c0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/05/24 08:16 bpf-next a1c818109cc8 f48c20b8 .config console log report ci-upstream-bpf-next-kasan-gce
2018/04/17 17:53 bpf-next 5d1365940a68 b80fd3b5 .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.