From mboxrd@z Thu Jan 1 00:00:00 1970 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 5153E1AB367 for ; Thu, 20 Jun 2024 11:17:37 +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=1718882258; cv=none; b=DExjQygEfphRCOkmhXnO995rDov+bsNT9KFOBCs20Ckk/yoryVgPpbRqLJQ/+y4olxta8Cup1L6vm9BSVnr+f9mueqislIu4BwKStcHRQCFXLCk3/0GRUBgPz3tHz/gmSGFO0orYbiIBkeKCIrJV6TP8sd8Ise3Vgj+o/G8+cZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718882258; c=relaxed/simple; bh=UFebUc/RYtlGrqf8MMHM+0zgBGlYfGup5fg4UeC23KE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=i8Gvxn6/SY058ANFXRxRweE9LUf7PNip4R1DlTBbGkUtcLk7akXId+1otIgu+KMwUynzFXR0zfN6Ep9MS6sBllJKd7cYypgVJ7yaBqSfcsVkHqiQNvrhGJPGMA36YwwmjYU2BGKaam+7F6pAyT3PiLyXxmqHdrD+gn4PbcAT+7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pfc4vnW9; 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="pfc4vnW9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7574BC32781; Thu, 20 Jun 2024 11:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718882257; bh=UFebUc/RYtlGrqf8MMHM+0zgBGlYfGup5fg4UeC23KE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=pfc4vnW9rKTUD0RnqaIMEB6koyQpmSF+AMq8e5ykshxkj1lGfo8PAs3sK/DOeiBCn 8oED6B4av87BiwLwmsVWyu+iwbokemPlO5yov5D3/iewTs8khke/hmk7VWY5P7wMq1 nR1UQ5mhqtrNXO/1DRBFIuMUOACyvlKnswb9OmNA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48746: net/mlx5e: Fix handling of wrong devices during bond netevent Date: Thu, 20 Jun 2024 13:16:26 +0200 Message-ID: <2024062004-CVE-2022-48746-3d3a@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=3801; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UFebUc/RYtlGrqf8MMHM+0zgBGlYfGup5fg4UeC23KE=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkl/CUTfikXmJx49Wc+Z7W15E+7JfNY0qV+bnkWcKnVc Y1C7XfXjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIoXSGBd1XTE/y/vGX3nTm J/u/ft/jswocGhjm2WleOR7Lqxv9d138utvq85lZOMX0AA== 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 handling of wrong devices during bond netevent Current implementation of bond netevent handler only check if the handled netdev is VF representor and it missing a check if the VF representor is on the same phys device of the bond handling the netevent. Fix by adding the missing check and optimizing the check if the netdev is VF representor so it will not access uninitialized private data and crashes. BUG: kernel NULL pointer dereference, address: 000000000000036c PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI Workqueue: eth3bond0 bond_mii_monitor [bonding] RIP: 0010:mlx5e_is_uplink_rep+0xc/0x50 [mlx5_core] RSP: 0018:ffff88812d69fd60 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff8881cf800000 RCX: 0000000000000000 RDX: ffff88812d69fe10 RSI: 000000000000001b RDI: ffff8881cf800880 RBP: ffff8881cf800000 R08: 00000445cabccf2b R09: 0000000000000008 R10: 0000000000000004 R11: 0000000000000008 R12: ffff88812d69fe10 R13: 00000000fffffffe R14: ffff88820c0f9000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88846fb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000036c CR3: 0000000103d80006 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mlx5e_eswitch_uplink_rep+0x31/0x40 [mlx5_core] mlx5e_rep_is_lag_netdev+0x94/0xc0 [mlx5_core] mlx5e_rep_esw_bond_netevent+0xeb/0x3d0 [mlx5_core] raw_notifier_call_chain+0x41/0x60 call_netdevice_notifiers_info+0x34/0x80 netdev_lower_state_changed+0x4e/0xa0 bond_mii_monitor+0x56b/0x640 [bonding] process_one_work+0x1b9/0x390 worker_thread+0x4d/0x3d0 ? rescuer_thread+0x350/0x350 kthread+0x124/0x150 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30 The Linux kernel CVE team has assigned CVE-2022-48746 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 7e51891a237f and fixed in 5.10.97 with commit a01ee1b8165f Issue introduced in 5.8 with commit 7e51891a237f and fixed in 5.15.20 with commit fe70126da606 Issue introduced in 5.8 with commit 7e51891a237f and fixed in 5.16.6 with commit 4fad499d7fec Issue introduced in 5.8 with commit 7e51891a237f and fixed in 5.17 with commit ec41332e02bd 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-2022-48746 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/rep/bond.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/a01ee1b8165f4161459b5ec4e728bc7130fe8cd4 https://git.kernel.org/stable/c/fe70126da6063c29ca161cdec7ad1dae9af836b3 https://git.kernel.org/stable/c/4fad499d7fece448e7230d5e5b92f6d8a073e0bb https://git.kernel.org/stable/c/ec41332e02bd0acf1f24206867bb6a02f5877a62