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 959151E889 for ; Wed, 19 Jun 2024 13:46:33 +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=1718804793; cv=none; b=PnmLCHCYQqMfbrhIZSDjX9wfK+Ys7e9gpw+ba3YyuYl1r4ShNIBCzuJL0NBClfn0QbgXW3xR2eoETujqXGsJ30v52/g3O23PCWlgm2E7mt/5RltSA5zkWsnWJMNDKyGT2nnkxZ1tXkDh0xughGBE+oCsYR3WktdDXGuqXDEP2qA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718804793; c=relaxed/simple; bh=1orGDmbs9sHDGo6Uo6zpe/QKawS6zhl/tlQJTc/g3mM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pucgSDeyhtuzLZQblRUHgaHtWFUYiq+hWQXOT+AwvC7GQaxyjU0kGG7aOq9KXKOOLE+J8nnGyKaU4jLS+AlvQqwvKw5KecJXjriGX6yDcghSB952mhEkHJUwkHrr8TgnaKq3y8Kx+kKMY5JVLpnCYFR8qtjSJ5O48x/YLaOzyg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=N9Ef5uU3; 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="N9Ef5uU3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D1FDC2BBFC; Wed, 19 Jun 2024 13:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718804793; bh=1orGDmbs9sHDGo6Uo6zpe/QKawS6zhl/tlQJTc/g3mM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=N9Ef5uU3IoZ2Crixkc4sRJ4fZnVdHp5eOqlIXIO/cfxy273aIdSKZP3I7QGGo+gdP 8fHwnYOhfredbZJuSCRYU7jfeMZQcLwqdWS8JxLtYvnqAXnfjnp6lpEZLisYHpG0QB oddtWQ7oiR3P56zV05uWAhkFmZOV81ZkcyMyli5I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38595: net/mlx5: Fix peer devlink set for SF representor devlink port Date: Wed, 19 Jun 2024 15:46:01 +0200 Message-ID: <2024061955-CVE-2024-38595-0721@gregkh> X-Mailer: git-send-email 2.45.2 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=4133; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=1orGDmbs9sHDGo6Uo6zpe/QKawS6zhl/tlQJTc/g3mM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlFD0UC4rumrikUfaD9lL35pUnSQlf2iK/xIeyLY7jM/ 9+8Wm3aEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPRmcowz2Ci2leG/58X8dr4 GssvivuROrWZj2Gu1J3TXJ4FywsqronZb+P6yHdsSm8+AA== 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: Fix peer devlink set for SF representor devlink port The cited patch change register devlink flow, and neglect to reflect the changes for peer devlink set logic. Peer devlink set is triggering a call trace if done after devl_register.[1] Hence, align peer devlink set logic with register devlink flow. [1] WARNING: CPU: 4 PID: 3394 at net/devlink/core.c:155 devlink_rel_nested_in_add+0x177/0x180 CPU: 4 PID: 3394 Comm: kworker/u40:1 Not tainted 6.9.0-rc4_for_linust_min_debug_2024_04_16_14_08 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Workqueue: mlx5_vhca_event0 mlx5_vhca_state_work_handler [mlx5_core] RIP: 0010:devlink_rel_nested_in_add+0x177/0x180 Call Trace: ? __warn+0x78/0x120 ? devlink_rel_nested_in_add+0x177/0x180 ? report_bug+0x16d/0x180 ? handle_bug+0x3c/0x60 ? exc_invalid_op+0x14/0x70 ? asm_exc_invalid_op+0x16/0x20 ? devlink_port_init+0x30/0x30 ? devlink_port_type_clear+0x50/0x50 ? devlink_rel_nested_in_add+0x177/0x180 ? devlink_rel_nested_in_add+0xdd/0x180 mlx5_sf_mdev_event+0x74/0xb0 [mlx5_core] notifier_call_chain+0x35/0xb0 blocking_notifier_call_chain+0x3d/0x60 mlx5_blocking_notifier_call_chain+0x22/0x30 [mlx5_core] mlx5_sf_dev_probe+0x185/0x3e0 [mlx5_core] auxiliary_bus_probe+0x38/0x80 ? driver_sysfs_add+0x51/0x80 really_probe+0xc5/0x3a0 ? driver_probe_device+0x90/0x90 __driver_probe_device+0x80/0x160 driver_probe_device+0x1e/0x90 __device_attach_driver+0x7d/0x100 bus_for_each_drv+0x80/0xd0 __device_attach+0xbc/0x1f0 bus_probe_device+0x86/0xa0 device_add+0x64f/0x860 __auxiliary_device_add+0x3b/0xa0 mlx5_sf_dev_add+0x139/0x330 [mlx5_core] mlx5_sf_dev_state_change_handler+0x1e4/0x250 [mlx5_core] notifier_call_chain+0x35/0xb0 blocking_notifier_call_chain+0x3d/0x60 mlx5_vhca_state_work_handler+0x151/0x200 [mlx5_core] process_one_work+0x13f/0x2e0 worker_thread+0x2bd/0x3c0 ? rescuer_thread+0x410/0x410 kthread+0xc4/0xf0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x2d/0x50 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork_asm+0x11/0x20 The Linux kernel CVE team has assigned CVE-2024-38595 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8.7 with commit 967caa3d37c0 and fixed in 6.8.12 with commit a05012017510 Issue introduced in 6.9 with commit bf729988303a and fixed in 6.9.3 with commit 05d9d7b66836 Issue introduced in 6.9 with commit bf729988303a and fixed in 6.10-rc1 with commit 3c453e8cc672 Issue introduced in 6.6.28 with commit 8c91c6085847 Issue introduced in 6.8.8 with commit 8256c1211dc6 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-38595 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/a0501201751034ebe7a22bd9483ed28fea1cd213 https://git.kernel.org/stable/c/05d9d7b66836d87c914f8fdd4b062b78e373458d https://git.kernel.org/stable/c/3c453e8cc672de1f9c662948dba43176bc68d7f0