syzbot


memory leak in xdp_umem_create

Status: fixed on 2020/11/16 12:12
Subsystems: net bpf
[Documentation on labels]
Reported-by: syzbot+eb71df123dc2be2c1456@syzkaller.appspotmail.com
Fix commit: e5e1a4bc916d xsk: Fix possible memory leak at socket close
First crash: 1470d, last: 1448d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH bpf] xsk: fix possible memory leak at socket close 2 (2) 2020/10/29 08:35
memory leak in xdp_umem_create 1 (2) 2020/10/24 16:22

Sample crash report:
executing program
executing program
executing program
BUG: memory leak
unreferenced object 0xffff888110b5f080 (size 96):
  comm "syz-executor818", pid 8480, jiffies 4294943027 (age 20.300s)
  hex dump (first 32 bytes):
    00 a0 e1 00 00 c9 ff ff 00 00 02 00 00 00 00 00  ................
    00 00 00 00 00 10 00 00 20 00 00 00 20 00 00 00  ........ ... ...
  backtrace:
    [<000000008f69962f>] kmalloc include/linux/slab.h:552 [inline]
    [<000000008f69962f>] kzalloc include/linux/slab.h:664 [inline]
    [<000000008f69962f>] xdp_umem_create+0x33/0x630 net/xdp/xdp_umem.c:229
    [<0000000038058329>] xsk_setsockopt+0x4ad/0x590 net/xdp/xsk.c:852
    [<00000000bc4e0599>] __sys_setsockopt+0x1b0/0x360 net/socket.c:2132
    [<00000000c13d6fc3>] __do_sys_setsockopt net/socket.c:2143 [inline]
    [<00000000c13d6fc3>] __se_sys_setsockopt net/socket.c:2140 [inline]
    [<00000000c13d6fc3>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2140
    [<0000000072c2d5c2>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000a8bc773f>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810ff09c00 (size 256):
  comm "syz-executor818", pid 8480, jiffies 4294943027 (age 20.300s)
  hex dump (first 32 bytes):
    00 00 4d 04 00 ea ff ff 40 00 4d 04 00 ea ff ff  ..M.....@.M.....
    80 00 4d 04 00 ea ff ff c0 00 4d 04 00 ea ff ff  ..M.......M.....
  backtrace:
    [<0000000087535838>] kmalloc_array include/linux/slab.h:592 [inline]
    [<0000000087535838>] kcalloc include/linux/slab.h:603 [inline]
    [<0000000087535838>] xdp_umem_pin_pages net/xdp/xdp_umem.c:89 [inline]
    [<0000000087535838>] xdp_umem_reg net/xdp/xdp_umem.c:207 [inline]
    [<0000000087535838>] xdp_umem_create+0x3cc/0x630 net/xdp/xdp_umem.c:240
    [<0000000038058329>] xsk_setsockopt+0x4ad/0x590 net/xdp/xsk.c:852
    [<00000000bc4e0599>] __sys_setsockopt+0x1b0/0x360 net/socket.c:2132
    [<00000000c13d6fc3>] __do_sys_setsockopt net/socket.c:2143 [inline]
    [<00000000c13d6fc3>] __se_sys_setsockopt net/socket.c:2140 [inline]
    [<00000000c13d6fc3>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2140
    [<0000000072c2d5c2>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000a8bc773f>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff888110b5f100 (size 96):
  comm "syz-executor818", pid 8481, jiffies 4294943637 (age 14.200s)
  hex dump (first 32 bytes):
    00 10 e4 00 00 c9 ff ff 00 00 02 00 00 00 00 00  ................
    00 00 00 00 00 10 00 00 20 00 00 00 20 00 00 00  ........ ... ...
  backtrace:
    [<000000008f69962f>] kmalloc include/linux/slab.h:552 [inline]
    [<000000008f69962f>] kzalloc include/linux/slab.h:664 [inline]
    [<000000008f69962f>] xdp_umem_create+0x33/0x630 net/xdp/xdp_umem.c:229
    [<0000000038058329>] xsk_setsockopt+0x4ad/0x590 net/xdp/xsk.c:852
    [<00000000bc4e0599>] __sys_setsockopt+0x1b0/0x360 net/socket.c:2132
    [<00000000c13d6fc3>] __do_sys_setsockopt net/socket.c:2143 [inline]
    [<00000000c13d6fc3>] __se_sys_setsockopt net/socket.c:2140 [inline]
    [<00000000c13d6fc3>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2140
    [<0000000072c2d5c2>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000a8bc773f>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff888110b5f300 (size 96):
  comm "syz-executor818", pid 8482, jiffies 4294944245 (age 8.120s)
  hex dump (first 32 bytes):
    00 20 e6 00 00 c9 ff ff 00 00 02 00 00 00 00 00  . ..............
    00 00 00 00 00 10 00 00 20 00 00 00 20 00 00 00  ........ ... ...
  backtrace:
    [<000000008f69962f>] kmalloc include/linux/slab.h:552 [inline]
    [<000000008f69962f>] kzalloc include/linux/slab.h:664 [inline]
    [<000000008f69962f>] xdp_umem_create+0x33/0x630 net/xdp/xdp_umem.c:229
    [<0000000038058329>] xsk_setsockopt+0x4ad/0x590 net/xdp/xsk.c:852
    [<00000000bc4e0599>] __sys_setsockopt+0x1b0/0x360 net/socket.c:2132
    [<00000000c13d6fc3>] __do_sys_setsockopt net/socket.c:2143 [inline]
    [<00000000c13d6fc3>] __se_sys_setsockopt net/socket.c:2140 [inline]
    [<00000000c13d6fc3>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2140
    [<0000000072c2d5c2>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000a8bc773f>] entry_SYSCALL_64_after_hwframe+0x44/0xa9


Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/11/12 13:08 upstream 3d5e28bff7ad 77a55c8e .config console log report syz C ci-upstream-gce-leak
2020/11/11 20:55 upstream eccc87672492 cca87986 .config console log report syz C ci-upstream-gce-leak
2020/11/11 17:34 upstream eccc87672492 cca87986 .config console log report syz C ci-upstream-gce-leak
2020/11/11 02:54 upstream e2f0c565ec70 cca87986 .config console log report syz C ci-upstream-gce-leak
2020/11/10 14:17 upstream 407ab579637c cca87986 .config console log report syz C ci-upstream-gce-leak
2020/11/09 20:27 upstream f8394f232b1e 64069d48 .config console log report syz C ci-upstream-gce-leak
2020/11/09 14:31 upstream f8394f232b1e 64069d48 .config console log report syz C ci-upstream-gce-leak
2020/11/08 18:41 upstream 4429f14aeea9 64069d48 .config console log report syz C ci-upstream-gce-leak
2020/11/08 11:29 upstream 4429f14aeea9 64069d48 .config console log report syz C ci-upstream-gce-leak
2020/11/07 18:06 upstream 659caaf65dc9 64069d48 .config console log report syz C ci-upstream-gce-leak
2020/11/05 04:26 upstream 4ef8451b3326 64069d48 .config console log report syz C ci-upstream-gce-leak
2020/11/02 19:13 upstream 3cea11cd5e3b 8bc4594f .config console log report syz C ci-upstream-gce-leak
2020/10/30 03:26 upstream 23859ae44402 a0c7169a .config console log report syz C ci-upstream-gce-leak
2020/10/29 15:01 upstream 23859ae44402 f24824d3 .config console log report syz C ci-upstream-gce-leak
2020/10/27 04:30 upstream 41ba50b0572e 8b3eaf58 .config console log report syz C ci-upstream-gce-leak
2020/10/22 03:09 upstream f804b3159482 be6b1582 .config console log report syz C ci-upstream-gce-leak
2020/10/21 16:52 upstream c4d6fe731176 99c64d5c .config console log report syz C ci-upstream-gce-leak
* Struck through repros no longer work on HEAD.