Subject: memory leak in bpf

From: syzbot <[email-masked]>
Date: Tue, 17 Nov 2020 19:50:19 -0800

Hello,

syzbot found the following issue on:

HEAD commit:    f01c30de Merge tag 'vfs-5.10-fixes-2' of git://git.kernel...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15b9b181500000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a3f13716fa0212fd
dashboard link: https://syzkaller.appspot.com/bug?extid=f3694595248708227d35
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14b78b81500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email-masked]

2020/11/14 15:01:05 executed programs: 33
2020/11/14 15:01:11 executed programs: 35
2020/11/14 15:01:17 executed programs: 37
2020/11/14 15:01:22 executed programs: 39
BUG: memory leak
unreferenced object 0xffff8881161c6440 (size 64):
  comm "syz-executor.0", pid 8961, jiffies 4295107077 (age 12.370s)
  hex dump (first 32 bytes):
    80 62 58 04 00 ea ff ff c0 17 37 04 00 ea ff ff  .bX.......7.....
    80 6f 47 04 00 ea ff ff 40 64 58 04 00 ea ff ff  .oG.....@dX.....
  backtrace:
    [<00000000189a27fd>] kmalloc_node include/linux/slab.h:575 [inline]
    [<00000000189a27fd>] bpf_ringbuf_area_alloc kernel/bpf/ringbuf.c:94 [inline]
    [<00000000189a27fd>] bpf_ringbuf_alloc kernel/bpf/ringbuf.c:135 [inline]
    [<00000000189a27fd>] ringbuf_map_alloc kernel/bpf/ringbuf.c:183 [inline]
    [<00000000189a27fd>] ringbuf_map_alloc+0x1be/0x410 kernel/bpf/ringbuf.c:150
    [<000000009e5cec3e>] find_and_alloc_map kernel/bpf/syscall.c:122 [inline]
    [<000000009e5cec3e>] map_create kernel/bpf/syscall.c:825 [inline]
    [<000000009e5cec3e>] __do_sys_bpf+0x7d0/0x30a0 kernel/bpf/syscall.c:4381
    [<00000000c513b5d1>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<0000000033006ec5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

---
This report 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 [email-masked].

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