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 B2D4F1AA7BA for ; Wed, 26 Feb 2025 01:58:38 +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=1740535118; cv=none; b=o9wtMZSu6wkwroJ7PSndkm9B4273Q2IL6/DgMDs1EtpQbwZDxHYtHVELrIrOX+smL6cdBmS2Tc9VUwDpEM8ze0hw5vjWc/vWcsTWJhSnPOC191E9MLWZnipDNaj9Fpb6PPyA7JwLgF8oQIANa5Wij72EjgiYt2jt3/2biVLL6lY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535118; c=relaxed/simple; bh=xIUjLfRO2MXB6V8AYTZWSJ4/OZAHUVXhWj7tWAJmiSo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gZCZpGckKS2OimgW3G727A7AMV9mJ31nlXerwTlEi+APFEQ+AjL82Rpjwrv8RG71gVFSMwVhP4STyjVQAc0iqcZzU5MDVXepIlW69ahTss6N6eSFOwqDWbC/ZLp3syViBdKA9WaFS6nilYjVvSHT4U3CzG0EP6RFIA6uCC0xIeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CrpvFjr2; 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="CrpvFjr2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89AB2C4CEDD; Wed, 26 Feb 2025 01:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535118; bh=xIUjLfRO2MXB6V8AYTZWSJ4/OZAHUVXhWj7tWAJmiSo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CrpvFjr2JxXk80xigTCD46LeeoVuS6ObkA9QPrwGWfv0Be6FtUAPn9/M5La8kJB2T f+eq3SB/J9KRwwLa70Zvp2szU6geu8fmLEhIRJFD/sanyTJoAgV7MBMnqGs0uE2HJa 9U1TR5TbpQAYJFmpHF8C4KsOg12ab23UzXHWnmdE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49134: mlxsw: spectrum: Guard against invalid local ports Date: Wed, 26 Feb 2025 02:55:39 +0100 Message-ID: <2025022606-CVE-2022-49134-f6cf@gregkh> X-Mailer: git-send-email 2.48.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=2457; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xIUjLfRO2MXB6V8AYTZWSJ4/OZAHUVXhWj7tWAJmiSo=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SuzsOn0+cajac8+bZ6Jh6RDvUziJtydWSfyW2Pol+ xxevZjeEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPpTmZYcGDHhJmvdx9cnzfT /Efm9+jq+4phAQwL1hof7infV3+xqeOM6sfNq1kE37H3AQA= 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: mlxsw: spectrum: Guard against invalid local ports When processing events generated by the device's firmware, the driver protects itself from events reported for non-existent local ports, but not for the CPU port (local port 0), which exists, but does not have all the fields as any local port. This can result in a NULL pointer dereference when trying access 'struct mlxsw_sp_port' fields which are not initialized for CPU port. Commit 63b08b1f6834 ("mlxsw: spectrum: Protect driver from buggy firmware") already handled such issue by bailing early when processing a PUDE event reported for the CPU port. Generalize the approach by moving the check to a common function and making use of it in all relevant places. The Linux kernel CVE team has assigned CVE-2022-49134 to this issue. Affected and fixed versions =========================== Fixed in 5.17.3 with commit 4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8 Fixed in 5.18 with commit bcdfd615f83b4bd04678109bf18022d1476e4bbf 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-49134 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/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.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/4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8 https://git.kernel.org/stable/c/bcdfd615f83b4bd04678109bf18022d1476e4bbf