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 C975F15D5B7 for ; Fri, 13 Sep 2024 05:32:07 +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=1726205527; cv=none; b=O1QhMDYKC+0WLtWrZDZOc53N58GJ6hKjEfG7yHIUfPewyTskozGuUF1lZBZsZeXGCDGuJHnwd2GDWft2oqJClC9FtnLXFKBWe+Gu+KzBIQn5+5v1Pe5P3dkGe5yr6kJZsvECNK5Msc53lLWbrIVJ7Pry0O/P0eN+K1fLtBFTIBE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726205527; c=relaxed/simple; bh=CXoQZbsMulERBDsA15dLgu3Om7+GpKQjixj/9KxX+Tg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Cgp008k2uuNM/m4guwF8rfD5sR3YM2j5ylK4ZXzxGPocmGddkSq0IENr309jsKC7OIbRkEjWjbmW9AbyHujSp0KPzejYVRi+JuROouCuXHflRyv9C7KJIBr4lRdYyg8FG8sIU7K4KrwbSD705+vR7zyP9wiELl7BE216QCLG1kw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CONGDvQs; 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="CONGDvQs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 531A2C4CEC0; Fri, 13 Sep 2024 05:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1726205527; bh=CXoQZbsMulERBDsA15dLgu3Om7+GpKQjixj/9KxX+Tg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CONGDvQsQm7ahwfJblxglTOkJelrcBJXZBrm8lGIoTYn3hslneKgD9I9vfTEYJHMi qLxcZfudR1aG8O4dtxH14wNMqpbE1t2hLvsWbro9Nopodmp+hQ5WXbcZd4l606zX/w 2O4ECz3tcXJP13pbaVr3fNvP30Uu1YzygF4YJG28= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-46682: nfsd: prevent panic for nfsv4.0 closed files in nfs4_show_open Date: Fri, 13 Sep 2024 07:30:43 +0200 Message-ID: <2024091337-CVE-2024-46682-df82@gregkh> X-Mailer: git-send-email 2.46.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=2688; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=CXoQZbsMulERBDsA15dLgu3Om7+GpKQjixj/9KxX+Tg=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmPz/5NMVH5Gz3/gMqEKVKPlm/c67Grf5UQ6y3v3RsnW W39xhYX1hHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQAT6X/NML/ueENQDmP43P5d zocOtfg1C797e4dhfi2j9AyLl7OUeDoL4hvNws+ypR+dCAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: nfsd: prevent panic for nfsv4.0 closed files in nfs4_show_open Prior to commit 3f29cc82a84c ("nfsd: split sc_status out of sc_type") states_show() relied on sc_type field to be of valid type before calling into a subfunction to show content of a particular stateid. From that commit, we split the validity of the stateid into sc_status and no longer changed sc_type to 0 while unhashing the stateid. This resulted in kernel oopsing for nfsv4.0 opens that stay around and in nfs4_show_open() would derefence sc_file which was NULL. Instead, for closed open stateids forgo displaying information that relies of having a valid sc_file. To reproduce: mount the server with 4.0, read and close a file and then on the server cat /proc/fs/nfsd/clients/2/states [ 513.590804] Call trace: [ 513.590925] _raw_spin_lock+0xcc/0x160 [ 513.591119] nfs4_show_open+0x78/0x2c0 [nfsd] [ 513.591412] states_show+0x44c/0x488 [nfsd] [ 513.591681] seq_read_iter+0x5d8/0x760 [ 513.591896] seq_read+0x188/0x208 [ 513.592075] vfs_read+0x148/0x470 [ 513.592241] ksys_read+0xcc/0x178 The Linux kernel CVE team has assigned CVE-2024-46682 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 3f29cc82a84c and fixed in 6.10.8 with commit ba0b697de298 Issue introduced in 6.9 with commit 3f29cc82a84c and fixed in 6.11-rc6 with commit a204501e1743 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-2024-46682 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/nfsd/nfs4state.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/ba0b697de298285301c71c258598226e06494236 https://git.kernel.org/stable/c/a204501e1743d695ca2930ed25a2be9f8ced96d3