syzbot


memory leak in do_seccomp (2)

Status: upstream: reported C repro on 2021/02/22 09:25
Reported-by: syzbot+ab17848fe269b573eb71@syzkaller.appspotmail.com
Fix commit: seccomp: Move copy_seccomp() to no failure path.
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 585d, last: 34d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream memory leak in do_seccomp C 6 751d 778d 17/24 fixed on 2020/10/10 01:52
Patch testing requests:
Created Duration User Patch Repo Result
2022/04/15 11:51 6m mudongliangabcd@gmail.com git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git -- report log
2021/03/29 17:40 8m alaaemadhossney.ae@gmail.com upstream report log

Sample crash report:
BUG: memory leak
unreferenced object 0xffff88810ced3500 (size 256):
  comm "syz-executor340", pid 3640, jiffies 4294955435 (age 8.050s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
  backtrace:
    [<ffffffff81372765>] kmalloc include/linux/slab.h:600 [inline]
    [<ffffffff81372765>] kzalloc include/linux/slab.h:733 [inline]
    [<ffffffff81372765>] seccomp_prepare_filter kernel/seccomp.c:666 [inline]
    [<ffffffff81372765>] seccomp_prepare_user_filter kernel/seccomp.c:708 [inline]
    [<ffffffff81372765>] seccomp_set_mode_filter kernel/seccomp.c:1871 [inline]
    [<ffffffff81372765>] do_seccomp+0x195/0x1240 kernel/seccomp.c:1991
    [<ffffffff845ad915>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff845ad915>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd


Crashes (4):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-gce-leak 2022/07/13 00:29 upstream 72a8e05d4f66 d91dd8ea .config log report syz C memory leak in do_seccomp
ci-upstream-gce-leak 2021/02/20 10:11 upstream f40ddce88593 f689d40a .config log report syz C memory leak in do_seccomp
ci-upstream-gce-leak 2022/08/25 09:44 upstream c40e8341e3b3 514514f6 .config log report syz memory leak in do_seccomp
ci-upstream-gce-leak 2021/10/11 17:25 upstream 64570fbc14f8 838e7e2c .config log report syz memory leak in do_seccomp
* Struck through repros no longer work on HEAD.