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 DABD31FBC95 for ; Mon, 21 Oct 2024 18:06:26 +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=1729533986; cv=none; b=pXTlrBPPj9PK8fFKBv99O6cx95cQQ/FJfvz0QgOa4aq/hZMpUGLQI6ceJurUlyHrRz/7dcP2Svbi5U/2DM5+/rtZCCRvch4vBFPj/26aHubXtNwzM3LOLJ5p3E+DAj1w099J5ZQbF4jRC5GUlMr4gsrUFnoO9lkIgMX7skddHhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729533986; c=relaxed/simple; bh=GtaF4lkW322x8dgSHpF+FDZLlHzMgaQ7KjGpms0nvNk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rVUsxYW6f6kNHjHcA1xhNBbLRkuDUtKuMtgBU0Y50WQhVzNhO1KPK0XBvTxXHpLU2SkEMd+LOKnPd94kRMEAzdZ6wSya/IYrSz9LkZLVEj9iyOG6Oj7zVfre8+dqXTYtRZ4o4Yip7J3UvcU+lJ2U5CXPbTqsNj0PkWFnVONUlhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Aw51JuXu; 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="Aw51JuXu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56A9CC4CEC3; Mon, 21 Oct 2024 18:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729533986; bh=GtaF4lkW322x8dgSHpF+FDZLlHzMgaQ7KjGpms0nvNk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Aw51JuXuUaScUMmMKrWopPmzL+jGr+8qZtCHbOrUGl1AmzqijxlKdQtXaDehw3sik SdD63T4uikwL5fWPnouEBGVbm1DSGwbEpULPdrwruTJW9IqDeIK3hmonQXF1l+Vj9d v9UiRpXyaDB0B5ZyuvS//oQuzd5atLNzx3AHVi2M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49953: net/mlx5e: Fix crash caused by calling __xfrm_state_delete() twice Date: Mon, 21 Oct 2024 20:02:41 +0200 Message-ID: <2024102130-CVE-2024-49953-5cf8@gregkh> X-Mailer: git-send-email 2.47.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=4534; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GtaF4lkW322x8dgSHpF+FDZLlHzMgaQ7KjGpms0nvNk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli037VnJtvLnUq6+Hxhs6eMvGr7xqN7lzWNVatcNv+0 K80MMSgI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYirsEwm2V1m391eu/0Q9Ou MFgdWfffZpfJC4Z5Bq1vjuSwel9eLnVwWtbcE587HTtmAwA= 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: net/mlx5e: Fix crash caused by calling __xfrm_state_delete() twice The km.state is not checked in driver's delayed work. When xfrm_state_check_expire() is called, the state can be reset to XFRM_STATE_EXPIRED, even if it is XFRM_STATE_DEAD already. This happens when xfrm state is deleted, but not freed yet. As __xfrm_state_delete() is called again in xfrm timer, the following crash occurs. To fix this issue, skip xfrm_state_check_expire() if km.state is not XFRM_STATE_VALID. Oops: general protection fault, probably for non-canonical address 0xdead000000000108: 0000 [#1] SMP CPU: 5 UID: 0 PID: 7448 Comm: kworker/u102:2 Not tainted 6.11.0-rc2+ #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Workqueue: mlx5e_ipsec: eth%d mlx5e_ipsec_handle_sw_limits [mlx5_core] RIP: 0010:__xfrm_state_delete+0x3d/0x1b0 Code: 0f 84 8b 01 00 00 48 89 fd c6 87 c8 00 00 00 05 48 8d bb 40 10 00 00 e8 11 04 1a 00 48 8b 95 b8 00 00 00 48 8b 85 c0 00 00 00 <48> 89 42 08 48 89 10 48 8b 55 10 48 b8 00 01 00 00 00 00 ad de 48 RSP: 0018:ffff88885f945ec8 EFLAGS: 00010246 RAX: dead000000000122 RBX: ffffffff82afa940 RCX: 0000000000000036 RDX: dead000000000100 RSI: 0000000000000000 RDI: ffffffff82afb980 RBP: ffff888109a20340 R08: ffff88885f945ea0 R09: 0000000000000000 R10: 0000000000000000 R11: ffff88885f945ff8 R12: 0000000000000246 R13: ffff888109a20340 R14: ffff88885f95f420 R15: ffff88885f95f400 FS: 0000000000000000(0000) GS:ffff88885f940000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2163102430 CR3: 00000001128d6001 CR4: 0000000000370eb0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? die_addr+0x33/0x90 ? exc_general_protection+0x1a2/0x390 ? asm_exc_general_protection+0x22/0x30 ? __xfrm_state_delete+0x3d/0x1b0 ? __xfrm_state_delete+0x2f/0x1b0 xfrm_timer_handler+0x174/0x350 ? __xfrm_state_delete+0x1b0/0x1b0 __hrtimer_run_queues+0x121/0x270 hrtimer_run_softirq+0x88/0xd0 handle_softirqs+0xcc/0x270 do_softirq+0x3c/0x50 __local_bh_enable_ip+0x47/0x50 mlx5e_ipsec_handle_sw_limits+0x7d/0x90 [mlx5_core] process_one_work+0x137/0x2d0 worker_thread+0x28d/0x3a0 ? rescuer_thread+0x480/0x480 kthread+0xb8/0xe0 ? kthread_park+0x80/0x80 ret_from_fork+0x2d/0x50 ? kthread_park+0x80/0x80 ret_from_fork_asm+0x11/0x20 The Linux kernel CVE team has assigned CVE-2024-49953 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit b2f7b01d36a9 and fixed in 6.6.55 with commit fab615ac9fcb Issue introduced in 6.4 with commit b2f7b01d36a9 and fixed in 6.10.14 with commit 0b1672834634 Issue introduced in 6.4 with commit b2f7b01d36a9 and fixed in 6.11.3 with commit 151e7dead1f5 Issue introduced in 6.4 with commit b2f7b01d36a9 and fixed in 6.12-rc2 with commit 7b124695db40 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-49953 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: drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.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/fab615ac9fcb8589222303099975d464d8857527 https://git.kernel.org/stable/c/0b1672834634df9ac9cedf856db9fc36d92c50ef https://git.kernel.org/stable/c/151e7dead1f5399a73c19c4b50307ea48aff1dc0 https://git.kernel.org/stable/c/7b124695db40d5c9c5295a94ae928a8d67a01c3d