Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA1322ECD08 for ; Fri, 25 Jul 2025 12:56:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753448198; cv=none; b=i8x1RBW23MaV1iAO1N2xmxIU+2iRnxRA62HdYCuIB+iXKk87+LKpagyG6Y89Zfe+QnykscRuh5j/XNqC4jhFl1oielPNODLbi05pn7pzBRJ4ZVV53pm432zmOcClpbk2kw+2dZrGJjBP1KPELfBlvF3oqT54tE6U5omUxB4uC40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753448198; c=relaxed/simple; bh=xXgEgAxzNuzYUqwm6WytaCkxKf97IvSAlVriyH/5yIs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AT8ofWV1Zn4j7XfUFRdYSHnuruMur1c9VfdkJfEj20r6zC9zc6jtyqVfOxMIdyUtODoAl7MG1UtPHNaoHOhH6LQF0YyzCONW/2d1H1mUSUfYm+pctfFaRlSiHgRg+NMFvzAw8fDqQBPpfplYNy42KO3uSWDd1xvi6DgbZgeKnQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b2F2gWY5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="b2F2gWY5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 001F9C4CEE7; Fri, 25 Jul 2025 12:56:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753448198; bh=xXgEgAxzNuzYUqwm6WytaCkxKf97IvSAlVriyH/5yIs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=b2F2gWY5m3WepTfc5gcOqQQIC8nWDoz/zsmoojmpl2rLTTBxNVXlxRz8781KoeXZV ZwkeItqjaz2+HTPhYGojMAgRhToL1Py+BG5od9Cr9Z8RngoX7jZZTmr/2zaAQv7+EP wVa8XHSakpgldugjXnRqZ/AkLa/W9mT9DlxyTiTs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38400: nfs: Clean up /proc/net/rpc/nfs when nfs_fs_proc_net_init() fails. Date: Fri, 25 Jul 2025 14:55:31 +0200 Message-ID: <2025072510-CVE-2025-38400-a0d2@gregkh> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=7612; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=SEJEAcj8rbg2aVkGtaViVQpZysPLw4knEtaPO9hzu4Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNdesO7SwLcwy4afzYffL/rbcOqLt6fj5e+/ac1YlLn 1fdC1q1tSOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmotnEML/GN/zqLNEq1fkr Q61z/V38nNZU5jHMT0+p7t3J9W9d/pJ1a+Y1CCQpBKaKAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: nfs: Clean up /proc/net/rpc/nfs when nfs_fs_proc_net_init() fails. syzbot reported a warning below [1] following a fault injection in nfs_fs_proc_net_init(). [0] When nfs_fs_proc_net_init() fails, /proc/net/rpc/nfs is not removed. Later, rpc_proc_exit() tries to remove /proc/net/rpc, and the warning is logged as the directory is not empty. Let's handle the error of nfs_fs_proc_net_init() properly. [0]: FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 UID: 0 PID: 6120 Comm: syz.2.27 Not tainted 6.16.0-rc1-syzkaller-00010-g2c4a1f3fe03e #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl (lib/dump_stack.c:123) should_fail_ex (lib/fault-inject.c:73 lib/fault-inject.c:174) should_failslab (mm/failslab.c:46) kmem_cache_alloc_noprof (mm/slub.c:4178 mm/slub.c:4204) __proc_create (fs/proc/generic.c:427) proc_create_reg (fs/proc/generic.c:554) proc_create_net_data (fs/proc/proc_net.c:120) nfs_fs_proc_net_init (fs/nfs/client.c:1409) nfs_net_init (fs/nfs/inode.c:2600) ops_init (net/core/net_namespace.c:138) setup_net (net/core/net_namespace.c:443) copy_net_ns (net/core/net_namespace.c:576) create_new_namespaces (kernel/nsproxy.c:110) unshare_nsproxy_namespaces (kernel/nsproxy.c:218 (discriminator 4)) ksys_unshare (kernel/fork.c:3123) __x64_sys_unshare (kernel/fork.c:3190) do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [1]: remove_proc_entry: removing non-empty directory 'net/rpc', leaking at least 'nfs' WARNING: CPU: 1 PID: 6120 at fs/proc/generic.c:727 remove_proc_entry+0x45e/0x530 fs/proc/generic.c:727 Modules linked in: CPU: 1 UID: 0 PID: 6120 Comm: syz.2.27 Not tainted 6.16.0-rc1-syzkaller-00010-g2c4a1f3fe03e #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 RIP: 0010:remove_proc_entry+0x45e/0x530 fs/proc/generic.c:727 Code: 3c 02 00 0f 85 85 00 00 00 48 8b 93 d8 00 00 00 4d 89 f0 4c 89 e9 48 c7 c6 40 ba a2 8b 48 c7 c7 60 b9 a2 8b e8 33 81 1d ff 90 <0f> 0b 90 90 e9 5f fe ff ff e8 04 69 5e ff 90 48 b8 00 00 00 00 00 RSP: 0018:ffffc90003637b08 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff88805f534140 RCX: ffffffff817a92c8 RDX: ffff88807da99e00 RSI: ffffffff817a92d5 RDI: 0000000000000001 RBP: ffff888033431ac0 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: ffff888033431a00 R13: ffff888033431ae4 R14: ffff888033184724 R15: dffffc0000000000 FS: 0000555580328500(0000) GS:ffff888124a62000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f71733743e0 CR3: 000000007f618000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: sunrpc_exit_net+0x46/0x90 net/sunrpc/sunrpc_syms.c:76 ops_exit_list net/core/net_namespace.c:200 [inline] ops_undo_list+0x2eb/0xab0 net/core/net_namespace.c:253 setup_net+0x2e1/0x510 net/core/net_namespace.c:457 copy_net_ns+0x2a6/0x5f0 net/core/net_namespace.c:574 create_new_namespaces+0x3ea/0xa90 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:218 ksys_unshare+0x45b/0xa40 kernel/fork.c:3121 __do_sys_unshare kernel/fork.c:3192 [inline] __se_sys_unshare kernel/fork.c:3190 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3190 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa1a6b8e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff3a090368 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 00007fa1a6db5fa0 RCX: 00007fa1a6b8e929 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000080 RBP: 00007fa1a6c10b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fa1a6db5fa0 R14: 00007fa1a6db5fa0 R15: 0000000000000001 The Linux kernel CVE team has assigned CVE-2025-38400 to this issue. Affected and fixed versions =========================== Issue introduced in 5.4.276 with commit 31dd0cda5aa0547de447aaf184812f85ccc34044 and fixed in 5.4.296 with commit 8785701fd7cd52ae74c0d2b35b82568df74e9dbb Issue introduced in 5.10.217 with commit 6eef21eb7a165601882dad0419a630e32d2d7a2c and fixed in 5.10.240 with commit 412534a1fb76958b88dca48360c6f3ad4f3390f4 Issue introduced in 5.15.159 with commit 0bbd429260821dfb81478749837d3e6377949ac6 and fixed in 5.15.187 with commit b92397ce96743e4cc090207e2df2a856cb4cef08 Issue introduced in 6.1.91 with commit 9dd86e9d34b1078dcd647220e96a205028bf4e6f and fixed in 6.1.144 with commit 7701c245ff1ac1a126bf431e72b24547519046ff Issue introduced in 6.6.31 with commit 53a0365c9f9f66e1a981bf9188d8716d682e0739 and fixed in 6.6.97 with commit d0877c479f44fe475f4c8c02c88ce9ad43e90298 Issue introduced in 6.9 with commit d47151b79e3220e72ae323b8b8e9d6da20dc884e and fixed in 6.12.37 with commit 3c94212b57bedec3a386ef3da1ef00602f5c3d1d Issue introduced in 6.9 with commit d47151b79e3220e72ae323b8b8e9d6da20dc884e and fixed in 6.15.6 with commit 6acf340f8c1d296bcf535986175f5d0d6f2aab09 Issue introduced in 6.9 with commit d47151b79e3220e72ae323b8b8e9d6da20dc884e and fixed in 6.16-rc5 with commit e8d6f3ab59468e230f3253efe5cb63efa35289f7 Issue introduced in 6.8.10 with commit e05194baae299f2148ab5f6bab659c6ce8d1f6d3 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-38400 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/nfs/inode.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/8785701fd7cd52ae74c0d2b35b82568df74e9dbb https://git.kernel.org/stable/c/412534a1fb76958b88dca48360c6f3ad4f3390f4 https://git.kernel.org/stable/c/b92397ce96743e4cc090207e2df2a856cb4cef08 https://git.kernel.org/stable/c/7701c245ff1ac1a126bf431e72b24547519046ff https://git.kernel.org/stable/c/d0877c479f44fe475f4c8c02c88ce9ad43e90298 https://git.kernel.org/stable/c/3c94212b57bedec3a386ef3da1ef00602f5c3d1d https://git.kernel.org/stable/c/6acf340f8c1d296bcf535986175f5d0d6f2aab09 https://git.kernel.org/stable/c/e8d6f3ab59468e230f3253efe5cb63efa35289f7