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 0A46F1448EF for ; Mon, 25 Mar 2024 09:16:46 +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=1711358207; cv=none; b=DwCoswCDda0Cq89vQi/rIEydX02ky4ZfP1G+unQw1o76vP/6RfoGuV4lzzK253pQb5P5DQDfsXJcwBRZDNqPx6ctIxr+YOi5OrEp2jl9vpRYglR3dRRnepHaB9F0Du+qpHXJfyE1G3TmcKa3LWAyHpyBlzQknSNEOyzxl/559Yo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711358207; c=relaxed/simple; bh=Hu7E2eMYuxoizbgam+jCs4t5HD4j+qUJIMOmw29eppk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Xt7nQnQwqpekPpFVTwmIZe1WEoBcW0VWYd/mgOQ2Y3jBdinn2/RA7B7N8or9vE6prc6YbHWaegfoE9yOoMJ8T/a0dCHjuBPy6DOxPfb3vCBaZqqGSuY87F0CjqlcHj2xM5DcmBWNNcMBNc/qlsmcjvebr3Bjceq1SUPG7xKlWhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=B0Z/YsO5; 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="B0Z/YsO5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2730AC433F1; Mon, 25 Mar 2024 09:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711358206; bh=Hu7E2eMYuxoizbgam+jCs4t5HD4j+qUJIMOmw29eppk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=B0Z/YsO53iU481oR0l2s579awP7XP7RLdGwRNFyIQJLeOk+rynffGT4XGSvpbP1C9 Kf0FnuC/3E5aTNOMPIoD2+25kbtEvF63/B3Dd7Kw7lUoKZ2ITGOoSCZVA104cd1Adw II2TFxa0TrLqv4uL29RPLr0fg1R88buNffa0JEHc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47159: net: dsa: fix a crash if ->get_sset_count() fails Date: Mon, 25 Mar 2024 10:16:35 +0100 Message-ID: <2024032533-CVE-2021-47159-9ac6@gregkh> X-Mailer: git-send-email 2.44.0 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=2488; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Hu7E2eMYuxoizbgam+jCs4t5HD4j+qUJIMOmw29eppk=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmMDh+NVTp/rb/ytvvIi5Z3xb0P8n/6Bz3oLtq6dafC8 to1DjpCHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjAR6VsMC9pXTudkcjieKxMq U+01IyiwV1FFkWF+nrixdt6DBw1iNn6Nfi8C+SqZFX8CAA== 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: dsa: fix a crash if ->get_sset_count() fails If ds->ops->get_sset_count() fails then it "count" is a negative error code such as -EOPNOTSUPP. Because "i" is an unsigned int, the negative error code is type promoted to a very high value and the loop will corrupt memory until the system crashes. Fix this by checking for error codes and changing the type of "i" to just int. The Linux kernel CVE team has assigned CVE-2021-47159 to this issue. Affected and fixed versions =========================== Issue introduced in 4.7 with commit badf3ada60ab and fixed in 4.19.193 with commit 0f2cb08c57ed Issue introduced in 4.7 with commit badf3ada60ab and fixed in 5.4.124 with commit ce5355f140a7 Issue introduced in 4.7 with commit badf3ada60ab and fixed in 5.10.42 with commit caff86f85512 Issue introduced in 4.7 with commit badf3ada60ab and fixed in 5.12.9 with commit 7b22466648a4 Issue introduced in 4.7 with commit badf3ada60ab and fixed in 5.13 with commit a269333fa5c0 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-2021-47159 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: net/dsa/master.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/0f2cb08c57edefb0e7b5045e0e3e9980a3d3aa37 https://git.kernel.org/stable/c/ce5355f140a7987011388c7e30c4f8fbe180d3e8 https://git.kernel.org/stable/c/caff86f85512b8e0d9830e8b8b0dfe13c68ce5b6 https://git.kernel.org/stable/c/7b22466648a4f8e3e94f57ca428d1531866d1373 https://git.kernel.org/stable/c/a269333fa5c0c8e53c92b5a28a6076a28cde3e83