syzbot


memory leak in prepare_creds (5)

Status: upstream: reported C repro on 2025/11/07 07:29
Subsystems: lsm
[Documentation on labels]
Reported-by: syzbot+099461f8558eb0a1f4f3@syzkaller.appspotmail.com
First crash: 6d01h, last: 2d05h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [lsm?] memory leak in prepare_creds (5) 0 (1) 2025/11/07 07:29
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream memory leak in prepare_creds (3) lsm 3 C 24 1021d 1299d 0/29 auto-obsoleted due to no activity on 2023/05/24 05:02
upstream memory leak in prepare_creds (2) lsm 3 C 2 1599d 1695d 20/29 fixed on 2021/11/10 00:50
upstream memory leak in prepare_creds (4) lsm 3 C 5 673d 772d 0/29 auto-obsoleted due to no activity on 2024/04/17 09:09
upstream memory leak in prepare_creds lsm 3 C 10 1726d 1900d 19/29 fixed on 2021/03/10 01:48

Sample crash report:
BUG: memory leak
unreferenced object 0xffff888104c9ea80 (size 184):
  comm "syz-executor", pid 5983, jiffies 4294942709
  hex dump (first 32 bytes):
    01 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 (crc 2cf254db):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    kmem_cache_alloc_noprof+0x397/0x5a0 mm/slub.c:5291
    prepare_creds+0x22/0x4f0 kernel/cred.c:212
    copy_creds+0x44/0x290 kernel/cred.c:312
    copy_process+0x706/0x27d0 kernel/fork.c:2046
    kernel_clone+0x119/0x6c0 kernel/fork.c:2609
    __do_sys_clone+0x7b/0xb0 kernel/fork.c:2750
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888102d690e0 (size 32):
  comm "syz-executor", pid 5983, jiffies 4294942709
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    f8 f2 85 00 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace (crc 894df7a1):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __do_kmalloc_node mm/slub.c:5645 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
    kmalloc_noprof include/linux/slab.h:961 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    lsm_blob_alloc+0x4d/0x70 security/security.c:690
    lsm_cred_alloc security/security.c:707 [inline]
    security_prepare_creds+0x30/0x270 security/security.c:3310
    prepare_creds+0x346/0x4f0 kernel/cred.c:242
    copy_creds+0x44/0x290 kernel/cred.c:312
    copy_process+0x706/0x27d0 kernel/fork.c:2046
    kernel_clone+0x119/0x6c0 kernel/fork.c:2609
    __do_sys_clone+0x7b/0xb0 kernel/fork.c:2750
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object (percpu) 0x607e4d658c68 (size 8):
  comm "syz.0.17", pid 6094, jiffies 4294942710
  hex dump (first 8 bytes on cpu 0):
    00 00 00 00 00 00 00 00                          ........
  backtrace (crc 0):
    pcpu_alloc_noprof+0x83a/0xd80 mm/percpu.c:1890
    percpu_ref_init+0x36/0x1e0 lib/percpu-refcount.c:72
    nfsd_create_serv+0xbe/0x290 fs/nfsd/nfssvc.c:623
    nfsd_svc+0xe7/0x4c0 fs/nfsd/nfssvc.c:781
    nfsd_nl_threads_set_doit+0x24e/0x520 fs/nfsd/nfsctl.c:1639
    genl_family_rcv_msg_doit+0x11e/0x190 net/netlink/genetlink.c:1115
    genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
    genl_rcv_msg+0x2fd/0x440 net/netlink/genetlink.c:1210
    netlink_rcv_skb+0x93/0x1d0 net/netlink/af_netlink.c:2552
    genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
    netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
    netlink_unicast+0x3a3/0x4f0 net/netlink/af_netlink.c:1346
    netlink_sendmsg+0x335/0x6b0 net/netlink/af_netlink.c:1896
    sock_sendmsg_nosec net/socket.c:727 [inline]
    __sock_sendmsg net/socket.c:742 [inline]
    ____sys_sendmsg+0x5a3/0x5e0 net/socket.c:2630
    ___sys_sendmsg+0xc8/0x130 net/socket.c:2684
    __sys_sendmsg+0xc7/0x140 net/socket.c:2716
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888111c75840 (size 64):
  comm "syz.0.17", pid 6094, jiffies 4294942710
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 80 40 eb d4 81 ff ff ff ff  ........@.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace (crc c9d2229d):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5762
    kmalloc_noprof include/linux/slab.h:957 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    percpu_ref_init+0x94/0x1e0 lib/percpu-refcount.c:76
    nfsd_create_serv+0xbe/0x290 fs/nfsd/nfssvc.c:623
    nfsd_svc+0xe7/0x4c0 fs/nfsd/nfssvc.c:781
    nfsd_nl_threads_set_doit+0x24e/0x520 fs/nfsd/nfsctl.c:1639
    genl_family_rcv_msg_doit+0x11e/0x190 net/netlink/genetlink.c:1115
    genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
    genl_rcv_msg+0x2fd/0x440 net/netlink/genetlink.c:1210
    netlink_rcv_skb+0x93/0x1d0 net/netlink/af_netlink.c:2552
    genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
    netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
    netlink_unicast+0x3a3/0x4f0 net/netlink/af_netlink.c:1346
    netlink_sendmsg+0x335/0x6b0 net/netlink/af_netlink.c:1896
    sock_sendmsg_nosec net/socket.c:727 [inline]
    __sock_sendmsg net/socket.c:742 [inline]
    ____sys_sendmsg+0x5a3/0x5e0 net/socket.c:2630
    ___sys_sendmsg+0xc8/0x130 net/socket.c:2684
    __sys_sendmsg+0xc7/0x140 net/socket.c:2716
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff8881050f4f00 (size 184):
  comm "syz-executor", pid 5983, jiffies 4294942739
  hex dump (first 32 bytes):
    01 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 (crc 5c926cc2):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    kmem_cache_alloc_noprof+0x397/0x5a0 mm/slub.c:5291
    prepare_creds+0x22/0x4f0 kernel/cred.c:212
    copy_creds+0x44/0x290 kernel/cred.c:312
    copy_process+0x706/0x27d0 kernel/fork.c:2046
    kernel_clone+0x119/0x6c0 kernel/fork.c:2609
    __do_sys_clone+0x7b/0xb0 kernel/fork.c:2750
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888102d69d60 (size 32):
  comm "syz-executor", pid 5983, jiffies 4294942739
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    f8 f2 85 00 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace (crc 894df7a1):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __do_kmalloc_node mm/slub.c:5645 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
    kmalloc_noprof include/linux/slab.h:961 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    lsm_blob_alloc+0x4d/0x70 security/security.c:690
    lsm_cred_alloc security/security.c:707 [inline]
    security_prepare_creds+0x30/0x270 security/security.c:3310
    prepare_creds+0x346/0x4f0 kernel/cred.c:242
    copy_creds+0x44/0x290 kernel/cred.c:312
    copy_process+0x706/0x27d0 kernel/fork.c:2046
    kernel_clone+0x119/0x6c0 kernel/fork.c:2609
    __do_sys_clone+0x7b/0xb0 kernel/fork.c:2750
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/08 05:20 upstream da32d155f4a8 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-gce-leak memory leak in prepare_creds
2025/11/07 15:13 upstream 4a0c9b339199 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-gce-leak memory leak in prepare_creds
2025/11/07 06:07 upstream c2c2ccfd4ba7 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-gce-leak memory leak in prepare_creds
2025/11/04 09:50 upstream 8bb886cb8f3a 686bf657 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-gce-leak memory leak in prepare_creds
2025/11/07 04:56 upstream c2c2ccfd4ba7 4e1406b4 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-gce-leak memory leak in prepare_creds
* Struck through repros no longer work on HEAD.