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 4677E1A239F for ; Fri, 9 May 2025 06:45:53 +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=1746773153; cv=none; b=uRk+QJ3aNfjCTe96CerrHf2yaQUHYiFm32Mu9KBs54xkrgE6Xcbm4CypEp3OHdeTE6313I4PqKg2qkSHS5DEpO5ZQB9qz3jCDE2R5WLShJD/Fd718FlE1MCH/vA3quUeLmWEAk33xOskW/rDjEfFF/ErO6lPPxMHUJS1jNu4AWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773153; c=relaxed/simple; bh=StC7sy/DdS+yIpS/SROVnTxnh5QUV26UDK4joV6IRHs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YWh2VzVgZBdBresWH1j1g+zXCpqUT6ii9A4fvFzwub4HoWKtnLuSC+1I2X4GO5WCs5A6FPXj7EW3PUKo27xoJ7aoTfVz5YcJ3McX0EFMjh64YWJ351y41De73Mg18Bib/oFa4Wo7ZWfpEyUSc3zyoxLjKR0gw11uaJlTCX9BZp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fNchu6xA; 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="fNchu6xA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7EFBC4CEE4; Fri, 9 May 2025 06:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746773153; bh=StC7sy/DdS+yIpS/SROVnTxnh5QUV26UDK4joV6IRHs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=fNchu6xAvyiDORweCFz7s5P9+GynykEeqhB4cqRTIl/zCkwOOYx4q7v0RL5QT45Jc tXb/TdLUWgkO/UYaNI7Bry7SHszICUJ+aWvWmlyQjdMJacLaAHVCcaHu4+99WfiXvE cwB77f4O9GymCJ5BExUpnsy4CITvJPFBLCg6yWl4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37876: netfs: Only create /proc/fs/netfs with CONFIG_PROC_FS Date: Fri, 9 May 2025 08:45:43 +0200 Message-ID: <2025050942-CVE-2025-37876-679c@gregkh> X-Mailer: git-send-email 2.49.0 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=4765; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=J833+bDvbJ3kJm2ZHAOyJT+WUN4tnq2S17TjgPyKPPA=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmyS6a1vdw7RyPxsmqr90oG39odr3LdvXZNtQ+ZaVmb1 lDyl29xRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEykeT7Dgpus+7juHTTde2D/ 4WMvv7at2Ba7TZNhnsrHmJ6AknNJ3/b8Ukyctiz/yo+YPgA= 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: netfs: Only create /proc/fs/netfs with CONFIG_PROC_FS When testing a special config: CONFIG_NETFS_SUPPORTS=y CONFIG_PROC_FS=n The system crashes with something like: [ 3.766197] ------------[ cut here ]------------ [ 3.766484] kernel BUG at mm/mempool.c:560! [ 3.766789] Oops: invalid opcode: 0000 [#1] SMP NOPTI [ 3.767123] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W [ 3.767777] Tainted: [W]=WARN [ 3.767968] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), [ 3.768523] RIP: 0010:mempool_alloc_slab.cold+0x17/0x19 [ 3.768847] Code: 50 fe ff 58 5b 5d 41 5c 41 5d 41 5e 41 5f e9 93 95 13 00 [ 3.769977] RSP: 0018:ffffc90000013998 EFLAGS: 00010286 [ 3.770315] RAX: 000000000000002f RBX: ffff888100ba8640 RCX: 0000000000000000 [ 3.770749] RDX: 0000000000000000 RSI: 0000000000000003 RDI: 00000000ffffffff [ 3.771217] RBP: 0000000000092880 R08: 0000000000000000 R09: ffffc90000013828 [ 3.771664] R10: 0000000000000001 R11: 00000000ffffffea R12: 0000000000092cc0 [ 3.772117] R13: 0000000000000400 R14: ffff8881004b1620 R15: ffffea0004ef7e40 [ 3.772554] FS: 0000000000000000(0000) GS:ffff8881b5f3c000(0000) knlGS:0000000000000000 [ 3.773061] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3.773443] CR2: ffffffff830901b4 CR3: 0000000004296001 CR4: 0000000000770ef0 [ 3.773884] PKRU: 55555554 [ 3.774058] Call Trace: [ 3.774232] [ 3.774371] mempool_alloc_noprof+0x6a/0x190 [ 3.774649] ? _printk+0x57/0x80 [ 3.774862] netfs_alloc_request+0x85/0x2ce [ 3.775147] netfs_readahead+0x28/0x170 [ 3.775395] read_pages+0x6c/0x350 [ 3.775623] ? srso_alias_return_thunk+0x5/0xfbef5 [ 3.775928] page_cache_ra_unbounded+0x1bd/0x2a0 [ 3.776247] filemap_get_pages+0x139/0x970 [ 3.776510] ? srso_alias_return_thunk+0x5/0xfbef5 [ 3.776820] filemap_read+0xf9/0x580 [ 3.777054] ? srso_alias_return_thunk+0x5/0xfbef5 [ 3.777368] ? srso_alias_return_thunk+0x5/0xfbef5 [ 3.777674] ? find_held_lock+0x32/0x90 [ 3.777929] ? netfs_start_io_read+0x19/0x70 [ 3.778221] ? netfs_start_io_read+0x19/0x70 [ 3.778489] ? srso_alias_return_thunk+0x5/0xfbef5 [ 3.778800] ? lock_acquired+0x1e6/0x450 [ 3.779054] ? srso_alias_return_thunk+0x5/0xfbef5 [ 3.779379] netfs_buffered_read_iter+0x57/0x80 [ 3.779670] __kernel_read+0x158/0x2c0 [ 3.779927] bprm_execve+0x300/0x7a0 [ 3.780185] kernel_execve+0x10c/0x140 [ 3.780423] ? __pfx_kernel_init+0x10/0x10 [ 3.780690] kernel_init+0xd5/0x150 [ 3.780910] ret_from_fork+0x2d/0x50 [ 3.781156] ? __pfx_kernel_init+0x10/0x10 [ 3.781414] ret_from_fork_asm+0x1a/0x30 [ 3.781677] [ 3.781823] Modules linked in: [ 3.782065] ---[ end trace 0000000000000000 ]--- This is caused by the following error path in netfs_init(): if (!proc_mkdir("fs/netfs", NULL)) goto error_proc; Fix this by adding ifdef in netfs_main(), so that /proc/fs/netfs is only created with CONFIG_PROC_FS. The Linux kernel CVE team has assigned CVE-2025-37876 to this issue. Affected and fixed versions =========================== Fixed in 6.12.26 with commit 2ef6eea2efce01d1956ace483216f6b6e26330c9 Fixed in 6.14.5 with commit 6c4c5e0b96a90f2a11c378e66edc1f25165e10b6 Fixed in 6.15-rc3 with commit 40cb48eba3b4b79e110c1a35d33a48cac54507a2 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-37876 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/netfs/main.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/2ef6eea2efce01d1956ace483216f6b6e26330c9 https://git.kernel.org/stable/c/6c4c5e0b96a90f2a11c378e66edc1f25165e10b6 https://git.kernel.org/stable/c/40cb48eba3b4b79e110c1a35d33a48cac54507a2