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 962002F619B for ; Thu, 18 Sep 2025 16:05:51 +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=1758211551; cv=none; b=oJAwuVLYJ8P2zCA0mk3be6TBUVYGRAwAK2fKKkTW55VMT/DWH1qreowU//TSfhva75dYcLd6Zn+4IPpnRPARQmdC+sB4e7rSx4/QL4dq8Bntr27bhwbNY3YkqVwsRZ1Y6q/NWQ+5prLACuQu++PdaFakXE3Pkws4XiIc4NJGEgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758211551; c=relaxed/simple; bh=klWzeCVDjDOOSmpT0CrXp5jJmt2I4FfQl+mQZwkLZX0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XlhjR8gFSaik1OCDN3QwUy5wApjXmllU80u/NzGDIEB60ki7aJDucvk/yYp5nWjpWrCx2fL/wIHgjro+hrDm5XWtUq/Ixdle6T2BM/kxuW0tUXAx4vtSKBY3tIycJT40RH9cyQq6R5UkbCaBToVu0B5oyL1c8aqz2c5DQ3zWkic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lWGJ/b+Y; 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="lWGJ/b+Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 144E1C4CEEB; Thu, 18 Sep 2025 16:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758211551; bh=klWzeCVDjDOOSmpT0CrXp5jJmt2I4FfQl+mQZwkLZX0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=lWGJ/b+Y0vI1oxYUZTOIcIWUIGHXgs6InLWWUE7Fo5zdG52pwcK7sTMt6/8BOxy1h qE+Qvh5ceiXFnkPAvotttRTO9XbEMo9svNHjmf6RzrFtgNZMRvXekxfRtWdcP9fk6W dDKkQHF3CmCxqExAHCNkVYeqXgvuJaFlTIrkkKbs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53440: nilfs2: fix sysfs interface lifetime Date: Thu, 18 Sep 2025 18:04:31 +0200 Message-ID: <2025091859-CVE-2023-53440-cd1e@gregkh> X-Mailer: git-send-email 2.51.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=4824; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UMAG11N1t3UGPGZS/BJWtjBnSBQZmpgT014na2rcO7s=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlndPNbGNQZ7Z89Xc2Zt62DY7Kw+P4XReVbfD9c87M/Z CX/J/BqRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExE8wXD/NwL7fN+pmaaBfz9 vTjZOHF2WnpHPcN8f/+kE3vzbSrUvO9v2rPs0JKL3femAAA= 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: nilfs2: fix sysfs interface lifetime The current nilfs2 sysfs support has issues with the timing of creation and deletion of sysfs entries, potentially leading to null pointer dereferences, use-after-free, and lockdep warnings. Some of the sysfs attributes for nilfs2 per-filesystem instance refer to metadata file "cpfile", "sufile", or "dat", but nilfs_sysfs_create_device_group that creates those attributes is executed before the inodes for these metadata files are loaded, and nilfs_sysfs_delete_device_group which deletes these sysfs entries is called after releasing their metadata file inodes. Therefore, access to some of these sysfs attributes may occur outside of the lifetime of these metadata files, resulting in inode NULL pointer dereferences or use-after-free. In addition, the call to nilfs_sysfs_create_device_group() is made during the locking period of the semaphore "ns_sem" of nilfs object, so the shrinker call caused by the memory allocation for the sysfs entries, may derive lock dependencies "ns_sem" -> (shrinker) -> "locks acquired in nilfs_evict_inode()". Since nilfs2 may acquire "ns_sem" deep in the call stack holding other locks via its error handler __nilfs_error(), this causes lockdep to report circular locking. This is a false positive and no circular locking actually occurs as no inodes exist yet when nilfs_sysfs_create_device_group() is called. Fortunately, the lockdep warnings can be resolved by simply moving the call to nilfs_sysfs_create_device_group() out of "ns_sem". This fixes these sysfs issues by revising where the device's sysfs interface is created/deleted and keeping its lifetime within the lifetime of the metadata files above. The Linux kernel CVE team has assigned CVE-2023-53440 to this issue. Affected and fixed versions =========================== Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 4.14.313 with commit d20dcec8f326deb77b6688f8441e014045dac457 Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 4.19.281 with commit 5fe0ea141fbb887d407f1bf572ebf24427480d5c Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 5.4.241 with commit 83b16a60e413148685739635901937e2f16a7873 Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 5.10.178 with commit 3dbee84bf9e3273c4bb9ca6fc18ff22fba23dd24 Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 5.15.107 with commit d540aea451ab5489777a8156560f1388449b3109 Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 6.1.24 with commit 1942ccb7d95f287a312fcbabfa8bc9ba501b1953 Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 6.2.11 with commit daf4eb3a908b108279b60172d2f176e70d2df875 Issue introduced in 3.17 with commit dd70edbde2627f47df118d899de6bbb55abcfdbf and fixed in 6.3 with commit 42560f9c92cc43dce75dbf06cc0d840dced39b12 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-2023-53440 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/nilfs2/super.c fs/nilfs2/the_nilfs.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/d20dcec8f326deb77b6688f8441e014045dac457 https://git.kernel.org/stable/c/5fe0ea141fbb887d407f1bf572ebf24427480d5c https://git.kernel.org/stable/c/83b16a60e413148685739635901937e2f16a7873 https://git.kernel.org/stable/c/3dbee84bf9e3273c4bb9ca6fc18ff22fba23dd24 https://git.kernel.org/stable/c/d540aea451ab5489777a8156560f1388449b3109 https://git.kernel.org/stable/c/1942ccb7d95f287a312fcbabfa8bc9ba501b1953 https://git.kernel.org/stable/c/daf4eb3a908b108279b60172d2f176e70d2df875 https://git.kernel.org/stable/c/42560f9c92cc43dce75dbf06cc0d840dced39b12