memory leak in process_preds

From: syzbot
Date: Mon May 27 2019 - 20:11:43 EST


Hello,

syzbot found the following crash on:

HEAD commit: cd6c84d8 Linux 5.2-rc2
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14039c36a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=64479170dcaf0e11
dashboard link: https://syzkaller.appspot.com/bug?extid=6b8e0fb820e570c59e19
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11f0a64ca00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13c64526a00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+6b8e0fb820e570c59e19@xxxxxxxxxxxxxxxxxxxxxxxxx

e list of known hosts.
executing program
BUG: memory leak
unreferenced object 0xffff88811fb1ee00 (size 512):
comm "syz-executor320", pid 7159, jiffies 4294942553 (age 7.920s)
hex dump (first 32 bytes):
90 09 31 81 ff ff ff ff 00 00 00 00 00 00 00 00 ..1.............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<0000000038eacd1e>] kmemleak_alloc_recursive include/linux/kmemleak.h:55 [inline]
[<0000000038eacd1e>] slab_post_alloc_hook mm/slab.h:439 [inline]
[<0000000038eacd1e>] slab_alloc mm/slab.c:3326 [inline]
[<0000000038eacd1e>] kmem_cache_alloc_trace+0x13d/0x280 mm/slab.c:3553
[<0000000074de3f6b>] kmalloc include/linux/slab.h:547 [inline]
[<0000000074de3f6b>] kzalloc include/linux/slab.h:742 [inline]
[<0000000074de3f6b>] parse_pred kernel/trace/trace_events_filter.c:1208 [inline]
[<0000000074de3f6b>] predicate_parse kernel/trace/trace_events_filter.c:474 [inline]
[<0000000074de3f6b>] process_preds+0x653/0x1780 kernel/trace/trace_events_filter.c:1525
[<0000000007c6ed68>] create_filter+0xa7/0x110 kernel/trace/trace_events_filter.c:1739
[<00000000a0b5fc40>] ftrace_profile_set_filter+0x76/0x120 kernel/trace/trace_events_filter.c:2066
[<000000001229a861>] perf_event_set_filter kernel/events/core.c:9403 [inline]
[<000000001229a861>] _perf_ioctl+0x5b6/0x830 kernel/events/core.c:5086
[<00000000fd2b26bf>] perf_ioctl+0x3b/0x60 kernel/events/core.c:5137
[<000000005c40f91e>] vfs_ioctl fs/ioctl.c:46 [inline]
[<000000005c40f91e>] file_ioctl fs/ioctl.c:509 [inline]
[<000000005c40f91e>] do_vfs_ioctl+0x62a/0x810 fs/ioctl.c:696
[<00000000f34a3a21>] ksys_ioctl+0x86/0xb0 fs/ioctl.c:713
[<00000000c96e9e33>] __do_sys_ioctl fs/ioctl.c:720 [inline]
[<00000000c96e9e33>] __se_sys_ioctl fs/ioctl.c:718 [inline]
[<00000000c96e9e33>] __x64_sys_ioctl+0x1e/0x30 fs/ioctl.c:718
[<0000000039965898>] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:301
[<00000000a08c0d8e>] entry_SYSCALL_64_after_hwframe+0x44/0xa9



---
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 syzkaller@xxxxxxxxxxxxxxxxx

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches