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 42FB323759 for ; Mon, 20 May 2024 09:44:03 +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=1716198243; cv=none; b=VYQKfqqzgqRITeHIzRjt2o0aPxNJX5vHMdr0r2armQKHyFoERAIHJFY86F2iJvqUxCML6ka6teiSZB+SmLBIAs6Z8H/2LREC1aR/IoHNfwE20IC+F/lojWQzjMGtwg1h5TBZQKXaztN6y01+aTgDMb7r4wnUxTdzTvSvNgLyKyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198243; c=relaxed/simple; bh=4nBymmiuvFlw9b8CrdxZVUglwwuK2fei7H1bSiE+5o0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iNERDqROhYFlpjFkQ13gG4Atw5nvUnEptmq6XK4SOdXqZoHWO94D+2j1EBwaGqNdOMOX7n6qHhqMkczblXvJzzZkUzD8+AKo+eQMtq2zG+ntOtuentoiJVo8DmBXoj1wZEbeTXhysdzVKaJJeyrZ7dskyto4RjsZ7bcvzrqBeWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jGkw+Skk; 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="jGkw+Skk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0C6AC2BD10; Mon, 20 May 2024 09:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716198243; bh=4nBymmiuvFlw9b8CrdxZVUglwwuK2fei7H1bSiE+5o0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jGkw+SkkgQqv2QGc1BNWibbQ5RQmhn16naltZXjXlanADEkMK6CMBqw0+G3W24SWc oKSRvAvEfPZNDKYPDtEW1iFrT3TbK1wvBvtiaHWZ+07SKkMl+sBUbMCG3PJcfeehK2 ysdGO0XVbC4ewQcEgu+2sFtv8oBdUxtOk+Oz2th8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35961: net/mlx5: Register devlink first under devlink lock Date: Mon, 20 May 2024 11:42:26 +0200 Message-ID: <2024052020-CVE-2024-35961-dbbf@gregkh> X-Mailer: git-send-email 2.45.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=3201; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4nBymmiuvFlw9b8CrdxZVUglwwuK2fei7H1bSiE+5o0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGneUn9O774wwyHB6XTnlceCG0pOfkz81icQ+Dx40ueqt XeSLggKd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBECqYyLDgltqXcx2Xlh+06 CTqKv1Y2s+93b2CYH8y5uKE+hyuysHLl9+sZ50NfzTlqDAA= 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/mlx5: Register devlink first under devlink lock In case device is having a non fatal FW error during probe, the driver will report the error to user via devlink. This will trigger a WARN_ON, since mlx5 is calling devlink_register() last. In order to avoid the WARN_ON[1], change mlx5 to invoke devl_register() first under devlink lock. [1] WARNING: CPU: 5 PID: 227 at net/devlink/health.c:483 devlink_recover_notify.constprop.0+0xb8/0xc0 CPU: 5 PID: 227 Comm: kworker/u16:3 Not tainted 6.4.0-rc5_for_upstream_min_debug_2023_06_12_12_38 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Workqueue: mlx5_health0000:08:00.0 mlx5_fw_reporter_err_work [mlx5_core] RIP: 0010:devlink_recover_notify.constprop.0+0xb8/0xc0 Call Trace: ? __warn+0x79/0x120 ? devlink_recover_notify.constprop.0+0xb8/0xc0 ? report_bug+0x17c/0x190 ? handle_bug+0x3c/0x60 ? exc_invalid_op+0x14/0x70 ? asm_exc_invalid_op+0x16/0x20 ? devlink_recover_notify.constprop.0+0xb8/0xc0 devlink_health_report+0x4a/0x1c0 mlx5_fw_reporter_err_work+0xa4/0xd0 [mlx5_core] process_one_work+0x1bb/0x3c0 ? process_one_work+0x3c0/0x3c0 worker_thread+0x4d/0x3c0 ? process_one_work+0x3c0/0x3c0 kthread+0xc6/0xf0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 The Linux kernel CVE team has assigned CVE-2024-35961 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit cf530217408e and fixed in 6.6.28 with commit 8c91c6085847 Issue introduced in 5.16 with commit cf530217408e and fixed in 6.8.7 with commit 967caa3d37c0 Issue introduced in 5.16 with commit cf530217408e and fixed in 6.9 with commit c6e77aa9dd82 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-35961 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/main.c drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.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/8c91c60858473731bcdaf04fda99fcbcf84420d4 https://git.kernel.org/stable/c/967caa3d37c078e5b95a32094657e6a4cad145f0 https://git.kernel.org/stable/c/c6e77aa9dd82bc18a89bf49418f8f7e961cfccc8