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 32D6B156968 for ; Mon, 29 Jul 2024 14:33:01 +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=1722263582; cv=none; b=iOuXpUZg+7m174EOSjoMB+sEEqyZsjw8vTkdieDgt6SM/ZUS20rEWEUAhnzCUCRjLI7TKb9Od4+AiceW498am2PljLJpILnTMxSSJE6WuSgVF2B8mpUf7hoQkvKX9gKuFQEh1XBnWJPucQUPnGVxy06Ffx4o5cM7+V07C/QewZ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722263582; c=relaxed/simple; bh=03VhM2g1Lg9RmDSP46nDyQqcAIPcR01nUxO24pdkpBo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YvWSeE7yeQz6e3kE1DkKqAkOFZ0mDm0QtMI1Ez4/SsT5Fv2XQq/jBagWZgsqcI8EWHTG/RI0jIRSdPxIgGZvJuEJOUhNZoUynqzqdqTmHYK8bs/I4WhGUGjL6WD7OlbHgvd9oQTrLwK3HupdQSwZmga2c2DtkU8Y+T0n018z5io= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LRj30va4; 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="LRj30va4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F8E3C32786; Mon, 29 Jul 2024 14:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722263581; bh=03VhM2g1Lg9RmDSP46nDyQqcAIPcR01nUxO24pdkpBo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=LRj30va40aCM/tfkShK1DBsigfwXOeNOJgARqRpYdKZm/AfbHDIWIZ4QYS47tv5vq uJEU8xoux8nwe8wFntuzgGQN8Bh90VEzWDVVPWd/2Cr4EHIsQgpaxX5JakrJmNxlLn HTF+Qv/rlre1ESmZ6XxmsEChSYO6wcneX7nVqRpo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-41039: firmware: cs_dsp: Fix overflow checking of wmfw header Date: Mon, 29 Jul 2024 16:32:34 +0200 Message-ID: <2024072924-CVE-2024-41039-b3bc@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=2735; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=03VhM2g1Lg9RmDSP46nDyQqcAIPcR01nUxO24pdkpBo=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnLl/8IdD/w9Z/3LunUv1ylPC1WDtEC7v4pGRZanbuYT 3XypLJ2xLIwCDIxyIopsnzZxnN0f8UhRS9D29Mwc1iZQIYwcHEKwETmZjHMYo5h5qjpKN3tdDmw eK+Aw65138zZGRZs7trZkPhbPcbd1rv6uIOmROeO1QsA 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: firmware: cs_dsp: Fix overflow checking of wmfw header Fix the checking that firmware file buffer is large enough for the wmfw header, to prevent overrunning the buffer. The original code tested that the firmware data buffer contained enough bytes for the sums of the size of the structs wmfw_header + wmfw_adsp1_sizes + wmfw_footer But wmfw_adsp1_sizes is only used on ADSP1 firmware. For ADSP2 and Halo Core the equivalent struct is wmfw_adsp2_sizes, which is 4 bytes longer. So the length check didn't guarantee that there are enough bytes in the firmware buffer for a header with wmfw_adsp2_sizes. This patch splits the length check into three separate parts. Each of the wmfw_header, wmfw_adsp?_sizes and wmfw_footer are checked separately before they are used. The Linux kernel CVE team has assigned CVE-2024-41039 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit f6bc909e7673 and fixed in 6.1.100 with commit fd035f0810b3 Issue introduced in 5.16 with commit f6bc909e7673 and fixed in 6.6.41 with commit 9c9877a96e03 Issue introduced in 5.16 with commit f6bc909e7673 and fixed in 6.9.10 with commit 49a79f344d0a Issue introduced in 5.16 with commit f6bc909e7673 and fixed in 6.10 with commit 3019b86bce16 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-41039 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/firmware/cirrus/cs_dsp.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/fd035f0810b33c2a8792effdb82bf35920221565 https://git.kernel.org/stable/c/9c9877a96e033bf6c6470b3b4f06106d91ace11e https://git.kernel.org/stable/c/49a79f344d0a17c6a5eef53716cc76fcdbfca9ba https://git.kernel.org/stable/c/3019b86bce16fbb5bc1964f3544d0ce7d0137278