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 750BC23759 for ; Mon, 20 May 2024 09:43:57 +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=1716198237; cv=none; b=q4OH3UTm22IU5rEX5U2vcpeL72ZXLy0ZrVlNZiahQVwKx3N+DJ7Mt80eaok3hjdxzrP6rcwDlzhoC5NIp4WQbJZQ4wbrsRseDpJQwg9Y13Cy9wLg7QP8yfFMvaIFLiue+OkAxc/B2RPUAizumNXrpE6GJUWcVvkWfAT7BgLDasg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198237; c=relaxed/simple; bh=9C45qxD+b+X75/dsmdnWdms6JTtTfbzxCa25jmHRkXs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e6SLbHCuEQP0a9xf3CdY86gFZktQSSqLrvthyH6K6WeVGFMHOc9yIkZEHO4Nk2nK02/HBiJHbtpQKc4oTXNjwYjy6OmQ3LjoU/SXYnYZyHcr0fyMqI0bj93pNfqNTBgVsT286DtxokeU0/FwbiHWqboutDlRg3O70NuCFr87Lp4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O0sWfuGk; 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="O0sWfuGk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02693C2BD10; Mon, 20 May 2024 09:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716198237; bh=9C45qxD+b+X75/dsmdnWdms6JTtTfbzxCa25jmHRkXs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=O0sWfuGkrG1JTDXVpHwHX+34RhZvvXqLxvJRjEv8MhrVJ0c7DxB9mUmjY2vppjOv0 Mc6uJIOP/J7GdOWqBrRpBEdXh+gtMeMt4+LvAmUmQ3KPVxKB1JHhrop530GcjbNXxK khwqlvaVPZQRsCfxBIVYCYpqE0CWejTUANU47ltA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35959: net/mlx5e: Fix mlx5e_priv_init() cleanup flow Date: Mon, 20 May 2024 11:42:24 +0200 Message-ID: <2024052019-CVE-2024-35959-6e06@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=3946; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9C45qxD+b+X75/dsmdnWdms6JTtTfbzxCa25jmHRkXs=; b=owGbwMvMwCRo6H6F97bub03G02pJDGneUr9XTr3r89yl7qPEnTv/ODd9FrQKN+xO5Xwgdep3q Ppa771rO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiWqcYFjQdPL0tLiA6eSq/ 3sImKTPD3psnfjDMZvs48wf3A8nfV1/sfpMTcWNaWfxSGQA= 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 mlx5e_priv_init() cleanup flow When mlx5e_priv_init() fails, the cleanup flow calls mlx5e_selq_cleanup which calls mlx5e_selq_apply() that assures that the `priv->state_lock` is held using lockdep_is_held(). Acquire the state_lock in mlx5e_selq_cleanup(). Kernel log: ============================= WARNING: suspicious RCU usage 6.8.0-rc3_net_next_841a9b5 #1 Not tainted ----------------------------- drivers/net/ethernet/mellanox/mlx5/core/en/selq.c:124 suspicious rcu_dereference_protected() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 2 locks held by systemd-modules/293: #0: ffffffffa05067b0 (devices_rwsem){++++}-{3:3}, at: ib_register_client+0x109/0x1b0 [ib_core] #1: ffff8881096c65c0 (&device->client_data_rwsem){++++}-{3:3}, at: add_client_context+0x104/0x1c0 [ib_core] stack backtrace: CPU: 4 PID: 293 Comm: systemd-modules Not tainted 6.8.0-rc3_net_next_841a9b5 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x8a/0xa0 lockdep_rcu_suspicious+0x154/0x1a0 mlx5e_selq_apply+0x94/0xa0 [mlx5_core] mlx5e_selq_cleanup+0x3a/0x60 [mlx5_core] mlx5e_priv_init+0x2be/0x2f0 [mlx5_core] mlx5_rdma_setup_rn+0x7c/0x1a0 [mlx5_core] rdma_init_netdev+0x4e/0x80 [ib_core] ? mlx5_rdma_netdev_free+0x70/0x70 [mlx5_core] ipoib_intf_init+0x64/0x550 [ib_ipoib] ipoib_intf_alloc+0x4e/0xc0 [ib_ipoib] ipoib_add_one+0xb0/0x360 [ib_ipoib] add_client_context+0x112/0x1c0 [ib_core] ib_register_client+0x166/0x1b0 [ib_core] ? 0xffffffffa0573000 ipoib_init_module+0xeb/0x1a0 [ib_ipoib] do_one_initcall+0x61/0x250 do_init_module+0x8a/0x270 init_module_from_file+0x8b/0xd0 idempotent_init_module+0x17d/0x230 __x64_sys_finit_module+0x61/0xb0 do_syscall_64+0x71/0x140 entry_SYSCALL_64_after_hwframe+0x46/0x4e The Linux kernel CVE team has assigned CVE-2024-35959 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 8bf30be75069 and fixed in 6.1.87 with commit ad26f26abd35 Issue introduced in 5.18 with commit 8bf30be75069 and fixed in 6.6.28 with commit f9ac93b6f3de Issue introduced in 5.18 with commit 8bf30be75069 and fixed in 6.8.7 with commit 6bd77865fda6 Issue introduced in 5.18 with commit 8bf30be75069 and fixed in 6.9 with commit ecb829459a84 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-35959 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/selq.c drivers/net/ethernet/mellanox/mlx5/core/en_main.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/ad26f26abd353113dea4e8d5ebadccdab9b61e76 https://git.kernel.org/stable/c/f9ac93b6f3de34aa0bb983b9be4f69ca50fc70f3 https://git.kernel.org/stable/c/6bd77865fda662913dcb5722a66a773840370aa7 https://git.kernel.org/stable/c/ecb829459a841198e142f72fadab56424ae96519