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 4CECF39654A for ; Tue, 16 Dec 2025 13:31:19 +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=1765891880; cv=none; b=TE1ouBryKwHt7KfWmtFEv1yROfPwvDzn9xi1r7M2KU2m/+aAgX1D1+xS/UXzbbfaRvje/BPoRX5JiJF0amh4VS5gbJrf0BJn8fK1K12P1gqK6mWpLeWT5cmbqIxvxHSXExTRNUh3HRiCmMMBY7V8G0A2Qh3YFWTuVSy26RG8hG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765891880; c=relaxed/simple; bh=4xvGjnAD9jJEsuj3TkEJbzAoTA0NmzF/tLNW8LZbwyY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V57CpcxQRc1Q/rae/zQXwX1sQp0reQByEXVrVIdNPMEJgspHE2tyle6kZYztK2WiHLiqnslqpSmJ+caLWukGRZ+7dfotdnDowU3luvWeIuaKO78E8PDNiZneWhFGqGVtsTEHBnoU1tufspwXDuSdJ9NDIyFXt0j4pcpWYkhliE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ekLKR3Lr; 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="ekLKR3Lr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E2DEC4CEF5; Tue, 16 Dec 2025 13:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765891879; bh=4xvGjnAD9jJEsuj3TkEJbzAoTA0NmzF/tLNW8LZbwyY=; h=From:To:Cc:Subject:Date:Reply-To:From; b=ekLKR3LrDbGqgdhsJr7TiS1/CAKwhctMaDL8SKjfDJZN9gd1SYSi9chqOPDct9nal KW6+SyZvsIxuIiV3Aql0evOQ311mZS8Xp9TDB1lgxBee9sm8XPVKXWrN+nbBSrM7Zx jk6r7eyV8mT66Q16HLVmlu7nrCgmroVFs3ZphoW0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40355: sysfs: check visibility before changing group attribute ownership Date: Tue, 16 Dec 2025 14:30:42 +0100 Message-ID: <2025121637-CVE-2025-40355-7b3b@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3591; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=/kuAbdWd23hUciCyUI4scMSWc6zI6evZeIfWx7sIzOE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmOcX+/bexbuivJ6fGsz1VfyqVa9JcrdHCLndCeF/tRV mG6yIn3HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRCdsZ5meK/Ajd+b3UeMO8 m3eZmbqnz7eMimKYH7PkXpfpvQDehArPqTZNP5LmhC36AAA= 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: sysfs: check visibility before changing group attribute ownership Since commit 0c17270f9b92 ("net: sysfs: Implement is_visible for phys_(port_id, port_name, switch_id)"), __dev_change_net_namespace() can hit WARN_ON() when trying to change owner of a file that isn't visible. See the trace below: WARNING: CPU: 6 PID: 2938 at net/core/dev.c:12410 __dev_change_net_namespace+0xb89/0xc30 CPU: 6 UID: 0 PID: 2938 Comm: incusd Not tainted 6.17.1-1-mainline #1 PREEMPT(full) 4b783b4a638669fb644857f484487d17cb45ed1f Hardware name: Framework Laptop 13 (AMD Ryzen 7040Series)/FRANMDCP07, BIOS 03.07 02/19/2025 RIP: 0010:__dev_change_net_namespace+0xb89/0xc30 [...] Call Trace: ? if6_seq_show+0x30/0x50 do_setlink.isra.0+0xc7/0x1270 ? __nla_validate_parse+0x5c/0xcc0 ? security_capable+0x94/0x1a0 rtnl_newlink+0x858/0xc20 ? update_curr+0x8e/0x1c0 ? update_entity_lag+0x71/0x80 ? sched_balance_newidle+0x358/0x450 ? psi_task_switch+0x113/0x2a0 ? __pfx_rtnl_newlink+0x10/0x10 rtnetlink_rcv_msg+0x346/0x3e0 ? sched_clock+0x10/0x30 ? __pfx_rtnetlink_rcv_msg+0x10/0x10 netlink_rcv_skb+0x59/0x110 netlink_unicast+0x285/0x3c0 ? __alloc_skb+0xdb/0x1a0 netlink_sendmsg+0x20d/0x430 ____sys_sendmsg+0x39f/0x3d0 ? import_iovec+0x2f/0x40 ___sys_sendmsg+0x99/0xe0 __sys_sendmsg+0x8a/0xf0 do_syscall_64+0x81/0x970 ? __sys_bind+0xe3/0x110 ? syscall_exit_work+0x143/0x1b0 ? do_syscall_64+0x244/0x970 ? sock_alloc_file+0x63/0xc0 ? syscall_exit_work+0x143/0x1b0 ? do_syscall_64+0x244/0x970 ? alloc_fd+0x12e/0x190 ? put_unused_fd+0x2a/0x70 ? do_sys_openat2+0xa2/0xe0 ? syscall_exit_work+0x143/0x1b0 ? do_syscall_64+0x244/0x970 ? exc_page_fault+0x7e/0x1a0 entry_SYSCALL_64_after_hwframe+0x76/0x7e [...] Fix this by checking is_visible() before trying to touch the attribute. The Linux kernel CVE team has assigned CVE-2025-40355 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 303a42769c4c4d8e5e3ad928df87eb36f8c1fa60 and fixed in 6.17.6 with commit ac2c526e103285d80a0330b91a318f6c9276d35a Issue introduced in 5.7 with commit 303a42769c4c4d8e5e3ad928df87eb36f8c1fa60 and fixed in 6.18 with commit c7fbb8218b4ad35fec0bd2256d2b9c8d60331f33 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-40355 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/sysfs/group.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/ac2c526e103285d80a0330b91a318f6c9276d35a https://git.kernel.org/stable/c/c7fbb8218b4ad35fec0bd2256d2b9c8d60331f33