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 1FD56168DC for ; Sun, 19 May 2024 08:35:41 +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=1716107741; cv=none; b=ISKCHNC8EsgGEZFFm8+5G069UJLx5MCm8h6CQG1iRSqy/dPM5lM2L9bXjwV4cF/NYQJLdGhBsJ+6NoMxakuXOuXer8tHGlN+exE+Wo9NWRTLpc+uM0G4jpu0baBvR8jLd8Fp5Y97ARg6sCTNfnQ0X3xFK6f69hkCvVvJ5SGNTlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716107741; c=relaxed/simple; bh=phJwiFA8TI/en4XUXFSND/90cUauYu3RoHbiJgprny4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Wbf3jR+eGZrDpGTUS9q2XhYqW5Wim72EsnvTcjDtCkAOD7JXEHfEJoqIoXiHsvCE1edFIZ1B9VgMdSsMW8yAHqijSITSWeGx8Fjq0GTNIfFRDV8CqJ+FWjvjG4U8lZldS/nFTQ16gLYUfBsaQc2HfmaaARA8QDZ5UBaRq5HF4Y0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Wr+tadp6; 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="Wr+tadp6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96AE8C32781; Sun, 19 May 2024 08:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716107741; bh=phJwiFA8TI/en4XUXFSND/90cUauYu3RoHbiJgprny4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Wr+tadp6o0HrY2FDCl06iidpmH90aa53HlznwBxEK3On6ZASi2ez+m2nVbEWAliLJ 3i0+3A5wFcY5wKeVxrseb4ZCdZYBfveNefoI1pJxWwSxgCCBQ4KXwwP/Sx5x9uvC14 xzSbUs+GKfnt5+Mqf8XPhYPbOTS3YPy5nf9Vr084= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35878: of: module: prevent NULL pointer dereference in vsnprintf() Date: Sun, 19 May 2024 10:34:52 +0200 Message-ID: <2024051943-CVE-2024-35878-5af8@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=2112; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=phJwiFA8TI/en4XUXFSND/90cUauYu3RoHbiJgprny4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmeO5fEMN8WVbY2jf1gsj6t4dC/ORlfxWXVGcwUt+T+P Sf+d9u2jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI1iCGBQ3cB/88DtVquZu0 6oPjObd5z3VVdRkW7DnzZcUbL65nnDnLlu5Xqm29FMJQCgA= 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: of: module: prevent NULL pointer dereference in vsnprintf() In of_modalias(), we can get passed the str and len parameters which would cause a kernel oops in vsnprintf() since it only allows passing a NULL ptr when the length is also 0. Also, we need to filter out the negative values of the len parameter as these will result in a really huge buffer since snprintf() takes size_t parameter while ours is ssize_t... Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool. The Linux kernel CVE team has assigned CVE-2024-35878 to this issue. Affected and fixed versions =========================== Fixed in 6.6.26 with commit e4a449368a2c Fixed in 6.8.5 with commit 544561dc56f7 Fixed in 6.9 with commit a1aa5390cc91 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-35878 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/of/module.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/e4a449368a2ce6d57a775d0ead27fc07f5a86e5b https://git.kernel.org/stable/c/544561dc56f7e69a053c25e11e6170f48bb97898 https://git.kernel.org/stable/c/a1aa5390cc912934fee76ce80af5f940452fa987