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 D4398BA53 for ; Sun, 29 Dec 2024 11:30:39 +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=1735471839; cv=none; b=krAtMFuZQp7FwaN5BUyBLIDS5I5CHsds8kpzcFRSf4G6HbYV+AjquXiu11rSb6ABl+00eq9Qak9McgZM04uXZVcXn+zN8vClti0NKQAhgD2w3nv2zG+clvS8aIMJa5woOsl8ihtfibCQAeFGGRoXLw2PdKvdAaI1AAJxhxOyz3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735471839; c=relaxed/simple; bh=uIetUcRBgJOEVVn1zSTG17MtVZywHESGHYszTSGQ/TU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fE6tEuBMFqTqndzrdogoCAg6OO2dzEGzNe1RA5ya7Uz5sWHL2a2DGNWgo/rC3FXh1pegw7gtsBjFbs8yqFSClM74G6sUq8gTOWuwiqdvOeRWYIUdBYyoTCjtAt/IqGHFoPNhdnlp0+UnMLvO0eWGObiL9NIIPGWMCWzI7NpuzXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YJWfk4J5; 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="YJWfk4J5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 569C3C4CED1; Sun, 29 Dec 2024 11:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735471839; bh=uIetUcRBgJOEVVn1zSTG17MtVZywHESGHYszTSGQ/TU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=YJWfk4J5eHOYuS0RZ6OYnwuQXWrUb+9epHdS4rG2uZHv+rUpJHCsbK3/clpeXV44s m7Nb96Ubt4qz1uR+oPwiBUAAk06Zu3zJq5xFx38SmRvzjJe/ZeQOsyBZouwsHnLltf 2mC0hYpTlw+XY3IgguOfdrkZqI0IpMS2+7msWON8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56743: nfs_common: must not hold RCU while calling nfsd_file_put_local Date: Sun, 29 Dec 2024 12:29:36 +0100 Message-ID: <2024122925-CVE-2024-56743-39a5@gregkh> X-Mailer: git-send-email 2.47.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=4651; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=uIetUcRBgJOEVVn1zSTG17MtVZywHESGHYszTSGQ/TU=; b=owGbwMvMwCRo6H6F97bub03G02pJDOmFRtMa2bYodR9sWvhS81RDmeuu9ON3jjLrTPB7v8v/3 r23WXkRHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR1RoMCw7/03X5d7IhSnHX b72XWrKdbSdFlBkWTJ4jMz1vx2qfNj/l3fO6yzYElbmvBwA= 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: nfs_common: must not hold RCU while calling nfsd_file_put_local Move holding the RCU from nfs_to_nfsd_file_put_local to nfs_to_nfsd_net_put. It is the call to nfs_to->nfsd_serv_put that requires the RCU anyway (the puts for nfsd_file and netns were combined to avoid an extra indirect reference but that micro-optimization isn't possible now). This fixes xfstests generic/013 and it triggering: "Voluntary context switch within RCU read-side critical section!" [ 143.545738] Call Trace: [ 143.546206] [ 143.546625] ? show_regs+0x6d/0x80 [ 143.547267] ? __warn+0x91/0x140 [ 143.547951] ? rcu_note_context_switch+0x496/0x5d0 [ 143.548856] ? report_bug+0x193/0x1a0 [ 143.549557] ? handle_bug+0x63/0xa0 [ 143.550214] ? exc_invalid_op+0x1d/0x80 [ 143.550938] ? asm_exc_invalid_op+0x1f/0x30 [ 143.551736] ? rcu_note_context_switch+0x496/0x5d0 [ 143.552634] ? wakeup_preempt+0x62/0x70 [ 143.553358] __schedule+0xaa/0x1380 [ 143.554025] ? _raw_spin_unlock_irqrestore+0x12/0x40 [ 143.554958] ? try_to_wake_up+0x1fe/0x6b0 [ 143.555715] ? wake_up_process+0x19/0x20 [ 143.556452] schedule+0x2e/0x120 [ 143.557066] schedule_preempt_disabled+0x19/0x30 [ 143.557933] rwsem_down_read_slowpath+0x24d/0x4a0 [ 143.558818] ? xfs_efi_item_format+0x50/0xc0 [xfs] [ 143.559894] down_read+0x4e/0xb0 [ 143.560519] xlog_cil_commit+0x1b2/0xbc0 [xfs] [ 143.561460] ? _raw_spin_unlock+0x12/0x30 [ 143.562212] ? xfs_inode_item_precommit+0xc7/0x220 [xfs] [ 143.563309] ? xfs_trans_run_precommits+0x69/0xd0 [xfs] [ 143.564394] __xfs_trans_commit+0xb5/0x330 [xfs] [ 143.565367] xfs_trans_roll+0x48/0xc0 [xfs] [ 143.566262] xfs_defer_trans_roll+0x57/0x100 [xfs] [ 143.567278] xfs_defer_finish_noroll+0x27a/0x490 [xfs] [ 143.568342] xfs_defer_finish+0x1a/0x80 [xfs] [ 143.569267] xfs_bunmapi_range+0x4d/0xb0 [xfs] [ 143.570208] xfs_itruncate_extents_flags+0x13d/0x230 [xfs] [ 143.571353] xfs_free_eofblocks+0x12e/0x190 [xfs] [ 143.572359] xfs_file_release+0x12d/0x140 [xfs] [ 143.573324] __fput+0xe8/0x2d0 [ 143.573922] __fput_sync+0x1d/0x30 [ 143.574574] nfsd_filp_close+0x33/0x60 [nfsd] [ 143.575430] nfsd_file_free+0x96/0x150 [nfsd] [ 143.576274] nfsd_file_put+0xf7/0x1a0 [nfsd] [ 143.577104] nfsd_file_put_local+0x18/0x30 [nfsd] [ 143.578070] nfs_close_local_fh+0x101/0x110 [nfs_localio] [ 143.579079] __put_nfs_open_context+0xc9/0x180 [nfs] [ 143.580031] nfs_file_clear_open_context+0x4a/0x60 [nfs] [ 143.581038] nfs_file_release+0x3e/0x60 [nfs] [ 143.581879] __fput+0xe8/0x2d0 [ 143.582464] __fput_sync+0x1d/0x30 [ 143.583108] __x64_sys_close+0x41/0x80 [ 143.583823] x64_sys_call+0x189a/0x20d0 [ 143.584552] do_syscall_64+0x64/0x170 [ 143.585240] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 143.586185] RIP: 0033:0x7f3c5153efd7 The Linux kernel CVE team has assigned CVE-2024-56743 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit 65f2a5c366353da6fa724c68347e1de954928143 and fixed in 6.12.2 with commit 3e6e3e97d64f50d9b6b1d62274f08925b1adbfc2 Issue introduced in 6.12 with commit 65f2a5c366353da6fa724c68347e1de954928143 and fixed in 6.13-rc1 with commit c840b8e1f039e90f97ca55525667eb961422f86c 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-56743 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_common/nfslocalio.c fs/nfsd/filecache.c fs/nfsd/filecache.h include/linux/nfslocalio.h 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/3e6e3e97d64f50d9b6b1d62274f08925b1adbfc2 https://git.kernel.org/stable/c/c840b8e1f039e90f97ca55525667eb961422f86c