[syzbot] memory leak in prepare_kernel_cred

From: syzbot
Date: Mon Sep 20 2021 - 11:42:40 EST


Hello,

syzbot found the following issue on:

HEAD commit: 4357f03d6611 Merge tag 'pm-5.15-rc2' of git://git.kernel.o..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16260b9b300000
kernel config: https://syzkaller.appspot.com/x/.config?x=84e947373389eef5
dashboard link: https://syzkaller.appspot.com/bug?extid=b214edc6e43f8da65554
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17a7cb3b300000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=103f8f2d300000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b214edc6e43f8da65554@xxxxxxxxxxxxxxxxxxxxxxxxx

write to /proc/sys/kernel/hung_task_check_interval_secs failed: No such file or directory
write to /proc/sys/kernel/softlockup_all_cpu_backtrace failed: No such file or directory
BUG: memory leak
unreferenced object 0xffff8881046d5480 (size 176):
comm "kworker/u4:0", pid 6631, jiffies 4294994696 (age 35.750s)
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:
[<ffffffff81275931>] prepare_kernel_cred+0x21/0x2e0 kernel/cred.c:724
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

BUG: memory leak
unreferenced object 0xffff888102054040 (size 32):
comm "kworker/u4:0", pid 6631, jiffies 4294994696 (age 35.750s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 b0 12 05 40 81 88 ff ff ...........@....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8213e79f>] lsm_cred_alloc security/security.c:537 [inline]
[<ffffffff8213e79f>] security_prepare_creds+0x9f/0xc0 security/security.c:1691
[<ffffffff81275ab5>] prepare_kernel_cred+0x1a5/0x2e0 kernel/cred.c:760
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

BUG: memory leak
unreferenced object 0xffff8881046d50c0 (size 176):
comm "kworker/u4:0", pid 6633, jiffies 4294994696 (age 35.750s)
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:
[<ffffffff81275931>] prepare_kernel_cred+0x21/0x2e0 kernel/cred.c:724
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

BUG: memory leak
unreferenced object 0xffff88810493f6c0 (size 176):
comm "kworker/u4:0", pid 6634, jiffies 4294994696 (age 35.750s)
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:
[<ffffffff81275931>] prepare_kernel_cred+0x21/0x2e0 kernel/cred.c:724
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

BUG: memory leak
unreferenced object 0xffff888104cec5e0 (size 32):
comm "kworker/u4:0", pid 6634, jiffies 4294994696 (age 35.750s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 b0 12 05 40 81 88 ff ff ...........@....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8213e79f>] lsm_cred_alloc security/security.c:537 [inline]
[<ffffffff8213e79f>] security_prepare_creds+0x9f/0xc0 security/security.c:1691
[<ffffffff81275ab5>] prepare_kernel_cred+0x1a5/0x2e0 kernel/cred.c:760
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

BUG: memory leak
unreferenced object 0xffff88810382b780 (size 176):
comm "kworker/u4:0", pid 6637, jiffies 4294994700 (age 35.710s)
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:
[<ffffffff81275931>] prepare_kernel_cred+0x21/0x2e0 kernel/cred.c:724
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

BUG: memory leak
unreferenced object 0xffff888102054060 (size 32):
comm "kworker/u4:0", pid 6637, jiffies 4294994700 (age 35.710s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 b0 12 05 40 81 88 ff ff ...........@....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8213e79f>] lsm_cred_alloc security/security.c:537 [inline]
[<ffffffff8213e79f>] security_prepare_creds+0x9f/0xc0 security/security.c:1691
[<ffffffff81275ab5>] prepare_kernel_cred+0x1a5/0x2e0 kernel/cred.c:760
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

BUG: memory leak
unreferenced object 0xffff888104c0a780 (size 176):
comm "kworker/u4:0", pid 6630, jiffies 4294994702 (age 35.690s)
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:
[<ffffffff81275931>] prepare_kernel_cred+0x21/0x2e0 kernel/cred.c:724
[<ffffffff8125fc6d>] call_usermodehelper_exec_async+0x5d/0x1c0 kernel/umh.c:91
[<ffffffff8100234f>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295



---
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 syzkaller@xxxxxxxxxxxxxxxx.

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