Skip to contentSkip to conversation

memory leak in do_seccomp

DISCUSSION syzbot 5 participants 8 messages Aug 11, 2020 – Sep 1, 2020

Subsystems (4)
lore
Share & tools
lore

syzbot

author syzbot
#0 lore raw

Hello,

syzbot found the following issue on:

HEAD commit:    449dc8c9 Merge tag 'for-v5.9' of git://git.kernel.org/pub/..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15d816c2900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=4810fa4a53b3aa2c
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=153d30e2900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

2020/08/09 00:29:47 executed programs: 3

BUG: memory leak
unreferenced object 0xffff88811310ea80 (size 96):
  comm "syz-executor.0", pid 6688, jiffies 4294954707 (age 12.810s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 30 e0 00 00 c9 ff ff  .........0......
  backtrace:
    [<0000000073bb6e7d>] kmalloc include/linux/slab.h:554 [inline]
    [<0000000073bb6e7d>] kzalloc include/linux/slab.h:666 [inline]
    [<0000000073bb6e7d>] seccomp_prepare_filter kernel/seccomp.c:562 [inline]
    [<0000000073bb6e7d>] seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
    [<0000000073bb6e7d>] seccomp_set_mode_filter kernel/seccomp.c:1535 [inline]
    [<0000000073bb6e7d>] do_seccomp+0x2ec/0xd40 kernel/seccomp.c:1649
    [<00000000658618a4>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000b8258e4d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffffc90000e03000 (size 4096):
  comm "syz-executor.0", pid 6688, jiffies 4294954707 (age 12.810s)
  hex dump (first 32 bytes):
    01 00 03 00 00 00 00 00 00 00 00 00 05 00 00 00  ................
    2d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  -...............
  backtrace:
    [<000000003b6a39af>] __vmalloc_node_range+0x2e1/0x3c0 mm/vmalloc.c:2520
    [<00000000eee59e12>] __vmalloc_node mm/vmalloc.c:2552 [inline]
    [<00000000eee59e12>] __vmalloc+0x49/0x50 mm/vmalloc.c:2566
    [<000000006e13ac2a>] bpf_prog_alloc_no_stats+0x32/0x100 kernel/bpf/core.c:85
    [<00000000cff3572c>] bpf_prog_alloc+0x1c/0xb0 kernel/bpf/core.c:111
    [<000000003222ffa9>] bpf_prog_create_from_user+0x5f/0x2a0 net/core/filter.c:1409
    [<00000000baa576ae>] seccomp_prepare_filter kernel/seccomp.c:567 [inline]
    [<00000000baa576ae>] seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
    [<00000000baa576ae>] seccomp_set_mode_filter kernel/seccomp.c:1535 [inline]
    [<00000000baa576ae>] do_seccomp+0x32e/0xd40 kernel/seccomp.c:1649
    [<00000000658618a4>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000b8258e4d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff888113bc1c00 (size 1024):
  comm "syz-executor.0", pid 6688, jiffies 4294954707 (age 12.810s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000000466b245>] kmalloc include/linux/slab.h:554 [inline]
    [<000000000466b245>] kzalloc include/linux/slab.h:666 [inline]
    [<000000000466b245>] bpf_prog_alloc_no_stats+0x73/0x100 kernel/bpf/core.c:89
    [<00000000cff3572c>] bpf_prog_alloc+0x1c/0xb0 kernel/bpf/core.c:111
    [<000000003222ffa9>] bpf_prog_create_from_user+0x5f/0x2a0 net/core/filter.c:1409
    [<00000000baa576ae>] seccomp_prepare_filter kernel/seccomp.c:567 [inline]
    [<00000000baa576ae>] seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
    [<00000000baa576ae>] seccomp_set_mode_filter kernel/seccomp.c:1535 [inline]
    [<00000000baa576ae>] do_seccomp+0x32e/0xd40 kernel/seccomp.c:1649
    [<00000000658618a4>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000b8258e4d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881154cb860 (size 32):
  comm "syz-executor.0", pid 6688, jiffies 4294954707 (age 12.810s)
  hex dump (first 32 bytes):
    01 00 73 74 65 6d 64 2d 00 5c d6 19 81 88 ff ff  ..stemd-.\......
    65 72 76 69 63 65 00 00 00 00 00 00 00 00 00 00  ervice..........
  backtrace:
    [<00000000561d65d4>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000561d65d4>] bpf_prog_store_orig_filter+0x33/0xa0 net/core/filter.c:1131
    [<000000005d9b7cd2>] bpf_prog_create_from_user+0xda/0x2a0 net/core/filter.c:1422
    [<00000000baa576ae>] seccomp_prepare_filter kernel/seccomp.c:567 [inline]
    [<00000000baa576ae>] seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
    [<00000000baa576ae>] seccomp_set_mode_filter kernel/seccomp.c:1535 [inline]
    [<00000000baa576ae>] do_seccomp+0x32e/0xd40 kernel/seccomp.c:1649
    [<00000000658618a4>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000b8258e4d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff888119d65c00 (size 32):
  comm "syz-executor.0", pid 6688, jiffies 4294954707 (age 12.810s)
  hex dump (first 32 bytes):
    06 00 00 00 fb ff ff 7f 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000ad603142>] kmemdup+0x23/0x50 mm/util.c:127
    [<0000000001d3eabf>] kmemdup include/linux/string.h:479 [inline]
    [<0000000001d3eabf>] bpf_prog_store_orig_filter+0x5e/0xa0 net/core/filter.c:1138
    [<000000005d9b7cd2>] bpf_prog_create_from_user+0xda/0x2a0 net/core/filter.c:1422
    [<00000000baa576ae>] seccomp_prepare_filter kernel/seccomp.c:567 [inline]
    [<00000000baa576ae>] seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
    [<00000000baa576ae>] seccomp_set_mode_filter kernel/seccomp.c:1535 [inline]
    [<00000000baa576ae>] do_seccomp+0x32e/0xd40 kernel/seccomp.c:1649
    [<00000000658618a4>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000b8258e4d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881131ecb00 (size 96):
  comm "syz-executor.0", pid 6688, jiffies 4294954707 (age 12.810s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
    80 ea 10 13 81 88 ff ff 00 b0 d8 00 00 c9 ff ff  ................
  backtrace:
    [<0000000073bb6e7d>] kmalloc include/linux/slab.h:554 [inline]
    [<0000000073bb6e7d>] kzalloc include/linux/slab.h:666 [inline]
    [<0000000073bb6e7d>] seccomp_prepare_filter kernel/seccomp.c:562 [inline]
    [<0000000073bb6e7d>] seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
    [<0000000073bb6e7d>] seccomp_set_mode_filter kernel/seccomp.c:1535 [inline]
    [<0000000073bb6e7d>] do_seccomp+0x2ec/0xd40 kernel/seccomp.c:1649
    [<00000000658618a4>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000b8258e4d>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811310e400 (size 96):
  comm "syz-executor.0", pid 6702, jiffies 4294955242 (age 7.460s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 50 e1 00 00 c9 ff ff  .........P......
  backtrace:
    [<0000000073bb6e7d>] kmalloc include/linux/slab.h:554 [inline]
    [<0000000073bb6e7d>] kzalloc include/linux/slab.h:666 [inline]
    [<0000000073bb6e7d>] seccomp_prepare_filter kernel/seccomp.c:562 [inline]
    [<0000000073bb6e7d>] seccomp_prepare_user_filter kernel/seccomp.c:604 [inline]
    [<0000000073bb6e7d>] seccomp_set_mode_filter kernel/seccomp.c:1535 [inline]
    [<0000000073bb6e7d>] do_seccomp+0x2ec/0xd40 kernel/seccomp.c:1649
    [<00000000658618a4>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000b8258e4d>] 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 protected].

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

author syzbot
#1 lore raw
syzbot has found a reproducer for the following issue on:

syzbot has found a reproducer for the following issue on:

HEAD commit:    dcc5c6f0 Merge tag 'x86-urgent-2020-08-30' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b297d5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=903b9fecc3c6d231
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14649561900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118aacc1900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

executing program
executing program
executing program
executing program
executing program

BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba936c0 (size 64):
  comm "syz-executor680", pid 6507, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 c8 36 a9 1b 81 88 ff ff  .........6......
    c8 36 a9 1b 81 88 ff ff da fb d1 41 a1 10 39 25  .6.........A..9%
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93700 (size 64):
  comm "syz-executor680", pid 6509, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 37 a9 1b 81 88 ff ff  .........7......
    08 37 a9 1b 81 88 ff ff d9 22 de 70 43 30 b3 2f  .7.......".pC0./
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93800 (size 64):
  comm "syz-executor680", pid 6511, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 38 a9 1b 81 88 ff ff  .........8......
    08 38 a9 1b 81 88 ff ff e4 c1 14 15 81 90 49 44  .8............ID
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb800 (size 64):
  comm "syz-executor680", pid 6506, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 b8 3c 19 81 88 ff ff  ..........<.....
    08 b8 3c 19 81 88 ff ff 87 43 ff ae fd 23 b0 15  ..<......C...#..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb740 (size 64):
  comm "syz-executor680", pid 6513, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b7 3c 19 81 88 ff ff  ........H.<.....
    48 b7 3c 19 81 88 ff ff 0b 68 b6 93 80 9b 8d 35  H.<......h.....5
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb640 (size 64):
  comm "syz-executor680", pid 6515, jiffies 4294951105 (age 21.930s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b6 3c 19 81 88 ff ff  ........H.<.....
    48 b6 3c 19 81 88 ff ff b4 5e 22 0a b5 50 fa a5  H.<......^"..P..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 23.180s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba936c0 (size 64):
  comm "syz-executor680", pid 6507, jiffies 4294951104 (age 23.180s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 c8 36 a9 1b 81 88 ff ff  .........6......
    c8 36 a9 1b 81 88 ff ff da fb d1 41 a1 10 39 25  .6.........A..9%
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93700 (size 64):
  comm "syz-executor680", pid 6509, jiffies 4294951104 (age 23.180s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 37 a9 1b 81 88 ff ff  .........7......
    08 37 a9 1b 81 88 ff ff d9 22 de 70 43 30 b3 2f  .7.......".pC0./
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93800 (size 64):
  comm "syz-executor680", pid 6511, jiffies 4294951104 (age 23.180s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 38 a9 1b 81 88 ff ff  .........8......
    08 38 a9 1b 81 88 ff ff e4 c1 14 15 81 90 49 44  .8............ID
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb800 (size 64):
  comm "syz-executor680", pid 6506, jiffies 4294951104 (age 23.180s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 b8 3c 19 81 88 ff ff  ..........<.....
    08 b8 3c 19 81 88 ff ff 87 43 ff ae fd 23 b0 15  ..<......C...#..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb740 (size 64):
  comm "syz-executor680", pid 6513, jiffies 4294951104 (age 23.180s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b7 3c 19 81 88 ff ff  ........H.<.....
    48 b7 3c 19 81 88 ff ff 0b 68 b6 93 80 9b 8d 35  H.<......h.....5
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb640 (size 64):
  comm "syz-executor680", pid 6515, jiffies 4294951105 (age 23.170s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b6 3c 19 81 88 ff ff  ........H.<.....
    48 b6 3c 19 81 88 ff ff b4 5e 22 0a b5 50 fa a5  H.<......^"..P..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 24.450s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba936c0 (size 64):
  comm "syz-executor680", pid 6507, jiffies 4294951104 (age 24.450s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 c8 36 a9 1b 81 88 ff ff  .........6......
    c8 36 a9 1b 81 88 ff ff da fb d1 41 a1 10 39 25  .6.........A..9%
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93700 (size 64):
  comm "syz-executor680", pid 6509, jiffies 4294951104 (age 24.450s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 37 a9 1b 81 88 ff ff  .........7......
    08 37 a9 1b 81 88 ff ff d9 22 de 70 43 30 b3 2f  .7.......".pC0./
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93800 (size 64):
  comm "syz-executor680", pid 6511, jiffies 4294951104 (age 24.450s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 38 a9 1b 81 88 ff ff  .........8......
    08 38 a9 1b 81 88 ff ff e4 c1 14 15 81 90 49 44  .8............ID
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb800 (size 64):
  comm "syz-executor680", pid 6506, jiffies 4294951104 (age 24.450s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 b8 3c 19 81 88 ff ff  ..........<.....
    08 b8 3c 19 81 88 ff ff 87 43 ff ae fd 23 b0 15  ..<......C...#..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb740 (size 64):
  comm "syz-executor680", pid 6513, jiffies 4294951104 (age 24.450s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b7 3c 19 81 88 ff ff  ........H.<.....
    48 b7 3c 19 81 88 ff ff 0b 68 b6 93 80 9b 8d 35  H.<......h.....5
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb640 (size 64):
  comm "syz-executor680", pid 6515, jiffies 4294951105 (age 24.440s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b6 3c 19 81 88 ff ff  ........H.<.....
    48 b6 3c 19 81 88 ff ff b4 5e 22 0a b5 50 fa a5  H.<......^"..P..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 25.710s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba936c0 (size 64):
  comm "syz-executor680", pid 6507, jiffies 4294951104 (age 25.710s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 c8 36 a9 1b 81 88 ff ff  .........6......
    c8 36 a9 1b 81 88 ff ff da fb d1 41 a1 10 39 25  .6.........A..9%
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93700 (size 64):
  comm "syz-executor680", pid 6509, jiffies 4294951104 (age 25.710s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 37 a9 1b 81 88 ff ff  .........7......
    08 37 a9 1b 81 88 ff ff d9 22 de 70 43 30 b3 2f  .7.......".pC0./
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93800 (size 64):
  comm "syz-executor680", pid 6511, jiffies 4294951104 (age 25.710s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 38 a9 1b 81 88 ff ff  .........8......
    08 38 a9 1b 81 88 ff ff e4 c1 14 15 81 90 49 44  .8............ID
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb800 (size 64):
  comm "syz-executor680", pid 6506, jiffies 4294951104 (age 25.710s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 b8 3c 19 81 88 ff ff  ..........<.....
    08 b8 3c 19 81 88 ff ff 87 43 ff ae fd 23 b0 15  ..<......C...#..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb740 (size 64):
  comm "syz-executor680", pid 6513, jiffies 4294951104 (age 25.710s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b7 3c 19 81 88 ff ff  ........H.<.....
    48 b7 3c 19 81 88 ff ff 0b 68 b6 93 80 9b 8d 35  H.<......h.....5
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb640 (size 64):
  comm "syz-executor680", pid 6515, jiffies 4294951105 (age 25.700s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b6 3c 19 81 88 ff ff  ........H.<.....
    48 b6 3c 19 81 88 ff ff b4 5e 22 0a b5 50 fa a5  H.<......^"..P..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 28.150s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba936c0 (size 64):
  comm "syz-executor680", pid 6507, jiffies 4294951104 (age 28.150s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 c8 36 a9 1b 81 88 ff ff  .........6......
    c8 36 a9 1b 81 88 ff ff da fb d1 41 a1 10 39 25  .6.........A..9%
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93700 (size 64):
  comm "syz-executor680", pid 6509, jiffies 4294951104 (age 28.150s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 37 a9 1b 81 88 ff ff  .........7......
    08 37 a9 1b 81 88 ff ff d9 22 de 70 43 30 b3 2f  .7.......".pC0./
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93800 (size 64):
  comm "syz-executor680", pid 6511, jiffies 4294951104 (age 28.150s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 38 a9 1b 81 88 ff ff  .........8......
    08 38 a9 1b 81 88 ff ff e4 c1 14 15 81 90 49 44  .8............ID
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb800 (size 64):
  comm "syz-executor680", pid 6506, jiffies 4294951104 (age 28.150s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 b8 3c 19 81 88 ff ff  ..........<.....
    08 b8 3c 19 81 88 ff ff 87 43 ff ae fd 23 b0 15  ..<......C...#..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb740 (size 64):
  comm "syz-executor680", pid 6513, jiffies 4294951104 (age 28.150s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b7 3c 19 81 88 ff ff  ........H.<.....
    48 b7 3c 19 81 88 ff ff 0b 68 b6 93 80 9b 8d 35  H.<......h.....5
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb640 (size 64):
  comm "syz-executor680", pid 6515, jiffies 4294951105 (age 28.140s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b6 3c 19 81 88 ff ff  ........H.<.....
    48 b6 3c 19 81 88 ff ff b4 5e 22 0a b5 50 fa a5  H.<......^"..P..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 29.390s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba936c0 (size 64):
  comm "syz-executor680", pid 6507, jiffies 4294951104 (age 29.390s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 c8 36 a9 1b 81 88 ff ff  .........6......
    c8 36 a9 1b 81 88 ff ff da fb d1 41 a1 10 39 25  .6.........A..9%
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93700 (size 64):
  comm "syz-executor680", pid 6509, jiffies 4294951104 (age 29.390s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 37 a9 1b 81 88 ff ff  .........7......
    08 37 a9 1b 81 88 ff ff d9 22 de 70 43 30 b3 2f  .7.......".pC0./
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ba93800 (size 64):
  comm "syz-executor680", pid 6511, jiffies 4294951104 (age 29.390s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 38 a9 1b 81 88 ff ff  .........8......
    08 38 a9 1b 81 88 ff ff e4 c1 14 15 81 90 49 44  .8............ID
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb800 (size 64):
  comm "syz-executor680", pid 6506, jiffies 4294951104 (age 29.390s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 b8 3c 19 81 88 ff ff  ..........<.....
    08 b8 3c 19 81 88 ff ff 87 43 ff ae fd 23 b0 15  ..<......C...#..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb740 (size 64):
  comm "syz-executor680", pid 6513, jiffies 4294951104 (age 29.390s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b7 3c 19 81 88 ff ff  ........H.<.....
    48 b7 3c 19 81 88 ff ff 0b 68 b6 93 80 9b 8d 35  H.<......h.....5
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881193cb640 (size 64):
  comm "syz-executor680", pid 6515, jiffies 4294951105 (age 29.380s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 48 b6 3c 19 81 88 ff ff  ........H.<.....
    48 b6 3c 19 81 88 ff ff b4 5e 22 0a b5 50 fa a5  H.<......^"..P..
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

executing program
executing program

#2 lore raw
Quoted 19 lines · syzbot

syzbot has found a reproducer for the following issue on:

HEAD commit:    dcc5c6f0 Merge tag 'x86-urgent-2020-08-30' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b297d5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=903b9fecc3c6d231
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14649561900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118aacc1900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

executing program
executing program
executing program
executing program
executing program

Quoted 14 lines
BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

I haven't narrowed this down yet (and it *might* be a false positive), but it looks like this is filter->notif. The only way that's possible is if seccomp_notify_release() was never called *and* seccomp_filter_free() got called... which would imply a reference counting problem. The way there doesn't jump out at me yet, but I haven't yet decoded the C reproducer into the actual seccomp arguments, etc.

Signature · 1 line
Kees Cook
#3 lore raw
Quoted 35 lines · Kees Cook
Quoted 19 lines · syzbot

syzbot has found a reproducer for the following issue on:

HEAD commit:    dcc5c6f0 Merge tag 'x86-urgent-2020-08-30' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b297d5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=903b9fecc3c6d231
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14649561900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118aacc1900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

executing program
executing program
executing program
executing program
executing program

Quoted 14 lines
BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Quoted 6 lines

I haven't narrowed this down yet (and it *might* be a false positive), but it looks like this is filter->notif. The only way that's possible is if seccomp_notify_release() was never called *and* seccomp_filter_free() got called... which would imply a reference counting problem. The way there doesn't jump out at me yet, but I haven't yet decoded the C reproducer into the actual seccomp arguments, etc.

Looks like it's just a bunch of threads in the same thread group trying to install a filter with TSYNC and NEW_LISTENER turned on. Does the patch below look reasonable?

I didn't send it separately since I'm in the process of switching my e-mail address to [email protected]; let this e-mail serve as proof that that e-mail really is me too :). I can send it the normal way if it looks good.

From d497e787e8e1b3e8b9230fdc4c9802616709c920 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <[email protected]>
Date: Mon, 31 Aug 2020 17:55:07 -0600
Subject: [PATCH] seccomp: don't leak memory when filter install races

In seccomp_set_mode_filter() with TSYNC | NEW_LISTENER, we first initialize the listener fd, then check to see if we can actually use it later in seccomp_may_assign_mode(), which can fail if anyone else in our thread group has installed a filter and caused some divergence. If we can't, we partially clean up the newly allocated file: we put the fd, put the file, but don't actually clean up the *memory* that was allocated at filter->notif. Let's clean that up too.

Fixes 51891498f2da ("seccomp: allow TSYNC and USER_NOTIF together")
Reported-by [email protected]
---
 kernel/seccomp.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/seccomp.c +2 -0
index 3ee59ce0a323..21a76127833f 100644
@@ -1581,6 +1581,8 @@ static long seccomp_set_mode_filter(unsigned int flags,
 			listener_f->private_data = NULL;
 			fput(listener_f);
 			put_unused_fd(listener);
+			kfree(filter->notif);
+			filter->notif = NULL;
 		} else {
 			fd_install(listener, listener_f);
 			ret = listener;

base-commit: b51594df17d0ce80b9f9f35394a1f42d7ac94472

Signature · 1 line
2.25.1
#4 lore raw
Quoted 78 lines · Tycho Andersen
Quoted 35 lines · Kees Cook
Quoted 19 lines · syzbot

syzbot has found a reproducer for the following issue on:

HEAD commit:    dcc5c6f0 Merge tag 'x86-urgent-2020-08-30' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b297d5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=903b9fecc3c6d231
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14649561900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118aacc1900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

executing program
executing program
executing program
executing program
executing program

Quoted 14 lines
BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Quoted 6 lines

I haven't narrowed this down yet (and it *might* be a false positive), but it looks like this is filter->notif. The only way that's possible is if seccomp_notify_release() was never called *and* seccomp_filter_free() got called... which would imply a reference counting problem. The way there doesn't jump out at me yet, but I haven't yet decoded the C reproducer into the actual seccomp arguments, etc.

Looks like it's just a bunch of threads in the same thread group trying to install a filter with TSYNC and NEW_LISTENER turned on. Does the patch below look reasonable?

I didn't send it separately since I'm in the process of switching my e-mail address to [email protected]; let this e-mail serve as proof that that e-mail really is me too :). I can send it the normal way if it looks good.

From d497e787e8e1b3e8b9230fdc4c9802616709c920 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <[email protected]>
Date: Mon, 31 Aug 2020 17:55:07 -0600
Subject: [PATCH] seccomp: don't leak memory when filter install races

In seccomp_set_mode_filter() with TSYNC | NEW_LISTENER, we first initialize the listener fd, then check to see if we can actually use it later in seccomp_may_assign_mode(), which can fail if anyone else in our thread group has installed a filter and caused some divergence. If we can't, we partially clean up the newly allocated file: we put the fd, put the file, but don't actually clean up the *memory* that was allocated at filter->notif. Let's clean that up too.

Fixes 51891498f2da ("seccomp: allow TSYNC and USER_NOTIF together")
Reported-by [email protected]
---
 kernel/seccomp.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/seccomp.c +0 -0
index 3ee59ce0a323..21a76127833f 100644

kernel/seccomp.c static long seccomp_set_mode_filter(unsigned int flags, · line 1585

Quoted 5 lines
kernel/seccomp.c +2 -0
@@ -1581,6 +1581,8 @@ static long seccomp_set_mode_filter(unsigned int flags,
 			listener_f->private_data = NULL;
 			fput(listener_f);
 			put_unused_fd(listener);
+			kfree(filter->notif);
+			filter->notif = NULL;

Oof, actually this isn't quite right. It should be s/filter/prepared/g. I can fix that and send out a real patch that's actually tested at some point tomorrow.

Tycho

#5 lore raw
Quoted 74 lines · Tycho Andersen
Quoted 73 lines · Tycho Andersen
Quoted 35 lines · Kees Cook
Quoted 19 lines · syzbot

syzbot has found a reproducer for the following issue on:

HEAD commit:    dcc5c6f0 Merge tag 'x86-urgent-2020-08-30' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b297d5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=903b9fecc3c6d231
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14649561900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118aacc1900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

executing program
executing program
executing program
executing program
executing program

Quoted 14 lines
BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Quoted 6 lines

I haven't narrowed this down yet (and it *might* be a false positive), but it looks like this is filter->notif. The only way that's possible is if seccomp_notify_release() was never called *and* seccomp_filter_free() got called... which would imply a reference counting problem. The way there doesn't jump out at me yet, but I haven't yet decoded the C reproducer into the actual seccomp arguments, etc.

Looks like it's just a bunch of threads in the same thread group trying to install a filter with TSYNC and NEW_LISTENER turned on. Does the patch below look reasonable?

I didn't send it separately since I'm in the process of switching my e-mail address to [email protected]; let this e-mail serve as proof that that e-mail really is me too :). I can send it the normal way if it looks good.

From d497e787e8e1b3e8b9230fdc4c9802616709c920 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <[email protected]>
Date: Mon, 31 Aug 2020 17:55:07 -0600
Subject: [PATCH] seccomp: don't leak memory when filter install races

In seccomp_set_mode_filter() with TSYNC | NEW_LISTENER, we first initialize the listener fd, then check to see if we can actually use it later in seccomp_may_assign_mode(), which can fail if anyone else in our thread group has installed a filter and caused some divergence. If we can't, we partially clean up the newly allocated file: we put the fd, put the file, but don't actually clean up the *memory* that was allocated at filter->notif. Let's clean that up too.

Fixes 51891498f2da ("seccomp: allow TSYNC and USER_NOTIF together")
Reported-by [email protected]
---
 kernel/seccomp.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 14 lines

kernel/seccomp.c static long seccomp_set_mode_filter(unsigned int flags, · line 1585

Quoted 10 lines
kernel/seccomp.c +2 -0
index 3ee59ce0a323..21a76127833f 100644
@@ -1581,6 +1581,8 @@ static long seccomp_set_mode_filter(unsigned int flags,
 			listener_f->private_data = NULL;
 			fput(listener_f);
 			put_unused_fd(listener);
+			kfree(filter->notif);
+			filter->notif = NULL;

Oof, actually this isn't quite right. It should be s/filter/prepared/g. I can fix that and send out a real patch that's actually tested at some point tomorrow.

Please do. :)
Do we have tests for this scenario in the selftests, Tycho?

Christian

#6 lore raw
In reply to Tycho Andersen
Quoted 74 lines · Tycho Andersen
Quoted 73 lines · Tycho Andersen
Quoted 35 lines · Kees Cook
Quoted 19 lines · syzbot

syzbot has found a reproducer for the following issue on:

HEAD commit:    dcc5c6f0 Merge tag 'x86-urgent-2020-08-30' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b297d5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=903b9fecc3c6d231
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14649561900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118aacc1900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

executing program
executing program
executing program
executing program
executing program

Quoted 14 lines
BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Quoted 6 lines

I haven't narrowed this down yet (and it *might* be a false positive), but it looks like this is filter->notif. The only way that's possible is if seccomp_notify_release() was never called *and* seccomp_filter_free() got called... which would imply a reference counting problem. The way there doesn't jump out at me yet, but I haven't yet decoded the C reproducer into the actual seccomp arguments, etc.

Looks like it's just a bunch of threads in the same thread group trying to install a filter with TSYNC and NEW_LISTENER turned on. Does the patch below look reasonable?

I didn't send it separately since I'm in the process of switching my e-mail address to [email protected]; let this e-mail serve as proof that that e-mail really is me too :). I can send it the normal way if it looks good.

From d497e787e8e1b3e8b9230fdc4c9802616709c920 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <[email protected]>
Date: Mon, 31 Aug 2020 17:55:07 -0600
Subject: [PATCH] seccomp: don't leak memory when filter install races

In seccomp_set_mode_filter() with TSYNC | NEW_LISTENER, we first initialize the listener fd, then check to see if we can actually use it later in seccomp_may_assign_mode(), which can fail if anyone else in our thread group has installed a filter and caused some divergence. If we can't, we partially clean up the newly allocated file: we put the fd, put the file, but don't actually clean up the *memory* that was allocated at filter->notif. Let's clean that up too.

Fixes 51891498f2da ("seccomp: allow TSYNC and USER_NOTIF together")
Reported-by [email protected]
---
 kernel/seccomp.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 14 lines

kernel/seccomp.c static long seccomp_set_mode_filter(unsigned int flags, · line 1585

Quoted 10 lines
kernel/seccomp.c +2 -0
index 3ee59ce0a323..21a76127833f 100644
@@ -1581,6 +1581,8 @@ static long seccomp_set_mode_filter(unsigned int flags,
 			listener_f->private_data = NULL;
 			fput(listener_f);
 			put_unused_fd(listener);
+			kfree(filter->notif);
+			filter->notif = NULL;

Oof, actually this isn't quite right. It should be s/filter/prepared/g. I can fix that and send out a real patch that's actually tested at some point tomorrow.

Ah! Yes, nice catch. I was staring at the wrong failure path. :)

I'm thinking the free/NULL pattern, since it's repeated in a few places, should likely be a short helper. I'll stare at this some more...

Signature · 1 line
Kees Cook
#7 lore raw
Quoted 90 lines · Kees Cook
Quoted 74 lines · Tycho Andersen
Quoted 73 lines · Tycho Andersen
Quoted 35 lines · Kees Cook
Quoted 19 lines · syzbot

syzbot has found a reproducer for the following issue on:

HEAD commit:    dcc5c6f0 Merge tag 'x86-urgent-2020-08-30' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10b297d5900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=903b9fecc3c6d231
dashboard link: https://syzkaller.appspot.com/bug?extid=3ad9614a12f80994c32e
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14649561900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=118aacc1900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]

executing program
executing program
executing program
executing program
executing program

Quoted 14 lines
BUG: memory leak
unreferenced object 0xffff88811ba93600 (size 64):
  comm "syz-executor680", pid 6503, jiffies 4294951104 (age 21.940s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 36 a9 1b 81 88 ff ff  .........6......
    08 36 a9 1b 81 88 ff ff 11 ce 98 89 3a d5 b4 8f  .6..........:...
  backtrace:
    [<00000000896418b0>] kmalloc include/linux/slab.h:554 [inline]
    [<00000000896418b0>] kzalloc include/linux/slab.h:666 [inline]
    [<00000000896418b0>] init_listener kernel/seccomp.c:1473 [inline]
    [<00000000896418b0>] seccomp_set_mode_filter kernel/seccomp.c:1546 [inline]
    [<00000000896418b0>] do_seccomp+0x8ce/0xd40 kernel/seccomp.c:1649
    [<000000002b04976c>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<00000000322b4126>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Quoted 6 lines

I haven't narrowed this down yet (and it *might* be a false positive), but it looks like this is filter->notif. The only way that's possible is if seccomp_notify_release() was never called *and* seccomp_filter_free() got called... which would imply a reference counting problem. The way there doesn't jump out at me yet, but I haven't yet decoded the C reproducer into the actual seccomp arguments, etc.

Looks like it's just a bunch of threads in the same thread group trying to install a filter with TSYNC and NEW_LISTENER turned on. Does the patch below look reasonable?

I didn't send it separately since I'm in the process of switching my e-mail address to [email protected]; let this e-mail serve as proof that that e-mail really is me too :). I can send it the normal way if it looks good.

From d497e787e8e1b3e8b9230fdc4c9802616709c920 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <[email protected]>
Date: Mon, 31 Aug 2020 17:55:07 -0600
Subject: [PATCH] seccomp: don't leak memory when filter install races

In seccomp_set_mode_filter() with TSYNC | NEW_LISTENER, we first initialize the listener fd, then check to see if we can actually use it later in seccomp_may_assign_mode(), which can fail if anyone else in our thread group has installed a filter and caused some divergence. If we can't, we partially clean up the newly allocated file: we put the fd, put the file, but don't actually clean up the *memory* that was allocated at filter->notif. Let's clean that up too.

Fixes 51891498f2da ("seccomp: allow TSYNC and USER_NOTIF together")
Reported-by [email protected]
---
 kernel/seccomp.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 14 lines

kernel/seccomp.c static long seccomp_set_mode_filter(unsigned int flags, · line 1585

Quoted 10 lines
kernel/seccomp.c +2 -0
index 3ee59ce0a323..21a76127833f 100644
@@ -1581,6 +1581,8 @@ static long seccomp_set_mode_filter(unsigned int flags,
 			listener_f->private_data = NULL;
 			fput(listener_f);
 			put_unused_fd(listener);
+			kfree(filter->notif);
+			filter->notif = NULL;

Oof, actually this isn't quite right. It should be s/filter/prepared/g. I can fix that and send out a real patch that's actually tested at some point tomorrow.

Quoted 4 lines

Ah! Yes, nice catch. I was staring at the wrong failure path. :)

I'm thinking the free/NULL pattern, since it's repeated in a few places, should likely be a short helper. I'll stare at this some more...

I think (?) it's just two, one here and one in seccomp_notify_release() but agreed. Maybe something like (untested):

kernel/seccomp.c +10 -5
index 3b593b4caaa5..bb0dd9ae699a 100644
@@ -1109,13 +1109,12 @@ static long seccomp_set_mode_strict(void)
 }
 
 #ifdef CONFIG_SECCOMP_FILTER
-static int seccomp_notify_release(struct inode *inode, struct file *file)
+static void seccomp_notify_detach(struct seccomp_filter *filter)
 {
-	struct seccomp_filter *filter = file->private_data;
 	struct seccomp_knotif *knotif;
 
 	if (!filter)
-		return 0;
+		return;
 
 	mutex_lock(&filter->notify_lock);
 
@@ -1142,6 +1141,13 @@ static int seccomp_notify_release(struct inode *inode, struct file *file)
 	kfree(filter->notif);
 	filter->notif = NULL;
 	mutex_unlock(&filter->notify_lock);
+}
+
+static int seccomp_notify_release(struct inode *inode, struct file *file)
+{
+	struct seccomp_filter *filter = file->private_data;
+
+	seccomp_notify_detach(filter);
 	__put_seccomp_filter(filter);
 	return 0;
 }
@@ -1581,8 +1587,7 @@ static long seccomp_set_mode_filter(unsigned int flags,
 			listener_f->private_data = NULL;
 			fput(listener_f);
 			put_unused_fd(listener);
-			kfree(prepared->notif);
-			filter->notif = NULL;
+			seccomp_notify_detach(prepared);
 		} else {
 			fd_install(listener, listener_f);
 			ret = listener;