syzbot


memory leak in smc_sysctl_net_init

Status: internal: reported C repro on 2022/03/25 05:18
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: 5ae6acf1d00b net/smc: fix a memory leak in smc_sysctl_net_exit()
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce 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-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 96d, last: 91d

Sample crash report:
Warning: Permanently added '10.128.0.171' (ECDSA) to the list of known hosts.
executing program
executing program
BUG: memory leak
unreferenced object 0xffff888109f4ca80 (size 128):
  comm "syz-executor482", pid 3599, jiffies 4294946023 (age 13.850s)
  hex dump (first 32 bytes):
    9f db 7a 85 ff ff ff ff c8 d0 9e 06 81 88 ff ff  ..z.............
    04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff814a70f3>] kmemdup+0x23/0x50 mm/util.c:128
    [<ffffffff841b2364>] kmemdup include/linux/fortify-string.h:440 [inline]
    [<ffffffff841b2364>] smc_sysctl_net_init+0x34/0xe0 net/smc/smc_sysctl.c:39
    [<ffffffff84184723>] smc_net_init+0x13/0x40 net/smc/af_smc.c:3184
    [<ffffffff837e9d5e>] ops_init+0x4e/0x190 net/core/net_namespace.c:134
    [<ffffffff837ea081>] setup_net+0x1e1/0x3f0 net/core/net_namespace.c:325
    [<ffffffff837ea8b0>] copy_net_ns+0x1a0/0x3e0 net/core/net_namespace.c:471
    [<ffffffff81277b29>] create_new_namespaces+0x199/0x4f0 kernel/nsproxy.c:110
    [<ffffffff8127848b>] unshare_nsproxy_namespaces+0x9b/0x120 kernel/nsproxy.c:226
    [<ffffffff8123a71e>] ksys_unshare+0x2fe/0x600 kernel/fork.c:3132
    [<ffffffff8123aa32>] __do_sys_unshare kernel/fork.c:3203 [inline]
    [<ffffffff8123aa32>] __se_sys_unshare kernel/fork.c:3201 [inline]
    [<ffffffff8123aa32>] __x64_sys_unshare+0x12/0x20 kernel/fork.c:3201
    [<ffffffff845105d5>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff845105d5>] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff888108ecaa00 (size 128):
  comm "syz-executor482", pid 3602, jiffies 4294946617 (age 7.910s)
  hex dump (first 32 bytes):
    9f db 7a 85 ff ff ff ff 08 b1 f9 09 81 88 ff ff  ..z.............
    04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff814a70f3>] kmemdup+0x23/0x50 mm/util.c:128
    [<ffffffff841b2364>] kmemdup include/linux/fortify-string.h:440 [inline]
    [<ffffffff841b2364>] smc_sysctl_net_init+0x34/0xe0 net/smc/smc_sysctl.c:39
    [<ffffffff84184723>] smc_net_init+0x13/0x40 net/smc/af_smc.c:3184
    [<ffffffff837e9d5e>] ops_init+0x4e/0x190 net/core/net_namespace.c:134
    [<ffffffff837ea081>] setup_net+0x1e1/0x3f0 net/core/net_namespace.c:325
    [<ffffffff837ea8b0>] copy_net_ns+0x1a0/0x3e0 net/core/net_namespace.c:471
    [<ffffffff81277b29>] create_new_namespaces+0x199/0x4f0 kernel/nsproxy.c:110
    [<ffffffff8127848b>] unshare_nsproxy_namespaces+0x9b/0x120 kernel/nsproxy.c:226
    [<ffffffff8123a71e>] ksys_unshare+0x2fe/0x600 kernel/fork.c:3132
    [<ffffffff8123aa32>] __do_sys_unshare kernel/fork.c:3203 [inline]
    [<ffffffff8123aa32>] __se_sys_unshare kernel/fork.c:3201 [inline]
    [<ffffffff8123aa32>] __x64_sys_unshare+0x12/0x20 kernel/fork.c:3201
    [<ffffffff845105d5>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff845105d5>] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae


Crashes (8):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-gce-leak 2022/03/29 09:36 upstream cffb2b72d3ed 6bdac766 .config log report syz C memory leak in smc_sysctl_net_init
ci-upstream-gce-leak 2022/03/28 05:51 upstream f82da161ea75 89bc8608 .config log report syz C memory leak in smc_sysctl_net_init
ci-upstream-gce-leak 2022/03/28 04:47 upstream f82da161ea75 89bc8608 .config log report syz C memory leak in smc_sysctl_net_init
ci-upstream-gce-leak 2022/03/27 21:30 upstream f022814633e1 89bc8608 .config log report syz C memory leak in smc_sysctl_net_init
ci-upstream-gce-leak 2022/03/27 19:48 upstream f022814633e1 89bc8608 .config log report syz C memory leak in smc_sysctl_net_init
ci-upstream-gce-leak 2022/03/25 20:20 upstream 34af78c4e616 89bc8608 .config log report syz C memory leak in smc_sysctl_net_init
ci-upstream-gce-leak 2022/03/25 05:17 upstream 52deda9551a0 89bc8608 .config log report syz C memory leak in smc_sysctl_net_init
ci-upstream-gce-leak 2022/03/29 14:49 upstream cffb2b72d3ed 6bdac766 .config log report syz memory leak in smc_sysctl_net_init