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 937A312EBEE for ; Tue, 21 May 2024 14:22: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=1716301353; cv=none; b=lqVgpGaEOasc9GV5e+0l+veOpxFuUCBrthQpnWd/bRicv7kbUFAE/iOD+W7ihYNRUxiXlUyrE8O/V9QS4ohZZfgmvt21RuubOa0tKqLUB5Mxh16LNxb7rmVYgjVaCxS9iJvyjdwGIva+2AJt68bmOzP3o4ufvtsdlaIdaPHBUSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716301353; c=relaxed/simple; bh=F+WghkyH6ZOetYDd/qG9UeEQWuhBJmgwbrvb1iLeV68=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IF1Fmm+jWkzTxt6bPT4CdwNBtjYeHRE2aTK1qY/ZKt9RPDt1YqEVCi7GjlNgQIgiqheTAoX0+dUp94i4zTVes70Y38TzGe4ixDpOucFWN2hJL0zHYnh/NhUdzh4QGFMoibZQCACXvKshnnKndS8kqqRyY2CGUV8qjrAaQzFKeIA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L27fLD/C; 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="L27fLD/C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C23B3C2BD11; Tue, 21 May 2024 14:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716301353; bh=F+WghkyH6ZOetYDd/qG9UeEQWuhBJmgwbrvb1iLeV68=; h=From:To:Cc:Subject:Date:Reply-to:From; b=L27fLD/CjrNg1LpKjZV7P/iHoRuTbRYiPqfZ5QpMOX1HfZh6Hnjd9r6pue0HkA7es zQjYQ2h+UQu3rra0KUTgV52sbRslGhZAZsrqOJWq9/0kVt6vys/bcAfsEYZVEpZtY9 aiKLC0OyS7pSuDQGd8fvEEEblC3DF52JA58+7SzM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47243: sch_cake: Fix out of bounds when parsing TCP options and header Date: Tue, 21 May 2024 16:19:57 +0200 Message-ID: <2024052142-CVE-2021-47243-830c@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=2883; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=F+WghkyH6ZOetYDd/qG9UeEQWuhBJmgwbrvb1iLeV68=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+a+ukm+Ivq9W4uOruEd7ac8/Ab83yCQsU2bL2H7e6o sb+qO1fRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEwkxYxhwf6il4xtFUEvZp7S uOMk+rz/yaLsGQzzK5/dmrnEsm1H1dKqKa8+P+TkeL9BCwA= 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: sch_cake: Fix out of bounds when parsing TCP options and header The TCP option parser in cake qdisc (cake_get_tcpopt and cake_tcph_may_drop) could read one byte out of bounds. When the length is 1, the execution flow gets into the loop, reads one byte of the opcode, and if the opcode is neither TCPOPT_EOL nor TCPOPT_NOP, it reads one more byte, which exceeds the length of 1. This fix is inspired by commit 9609dad263f8 ("ipv4: tcp_input: fix stack out of bounds when parsing TCP options."). v2 changes: Added doff validation in cake_get_tcphdr to avoid parsing garbage as TCP header. Although it wasn't strictly an out-of-bounds access (memory was allocated), garbage values could be read where CAKE expected the TCP header if doff was smaller than 5. The Linux kernel CVE team has assigned CVE-2021-47243 to this issue. Affected and fixed versions =========================== Issue introduced in 4.19 with commit 8b7138814f29 and fixed in 4.19.196 with commit 595897ef118d Issue introduced in 4.19 with commit 8b7138814f29 and fixed in 5.4.128 with commit 4cefa061fc63 Issue introduced in 4.19 with commit 8b7138814f29 and fixed in 5.10.46 with commit 3b491dd593d5 Issue introduced in 4.19 with commit 8b7138814f29 and fixed in 5.12.13 with commit 3371392c60e2 Issue introduced in 4.19 with commit 8b7138814f29 and fixed in 5.13 with commit ba91c49dedbd 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-47243 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/sched/sch_cake.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/595897ef118d6fe66690c4fc5b572028c9da95b7 https://git.kernel.org/stable/c/4cefa061fc63f4d2dff5ab4083f43857cd7a2335 https://git.kernel.org/stable/c/3b491dd593d582ceeb27aa617600712a6bd14246 https://git.kernel.org/stable/c/3371392c60e2685af30bd4547badd880f5df2b3f https://git.kernel.org/stable/c/ba91c49dedbde758ba0b72f57ac90b06ddf8e548