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 18C8C1E6DDE for ; Wed, 4 Sep 2024 19:58:07 +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=1725479888; cv=none; b=gGEX9kXGXJ7YiCnFuktATz7u8F8q0DNf92Cblz+vNSRJ0Z1gqWLBvYJ373xS+b+hRGQmXANBevwz5TF5YdaXq1mnGnn8bYpJp2clviCSUEyP8Ak1s5CrwBbepvUUfaptqj/oELc/1vNkW3UMUOa9GEZq77KEsdsK8hYdPMeznhA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725479888; c=relaxed/simple; bh=64OvBJP69qJw6P7EgmSJroBGhOwbLbJG8IG6nSLkGmo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tNl5YuARgi+XJzTt6MyZE66jjwsIRG+kR4iO1/cXpwLPNjFZY7Hln2cPWWpkRbbBs2SQlfaNvFNgQC8RuHgxFFNOjXEl77+nFZpEcc7CcwMiYjN0Y2hw9p/j7qrLZ5lF8SexJmxe8e6otuMlzfMhMWQ1HcA5lxZBPJycWkChBeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ovZsEM5X; 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="ovZsEM5X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4995AC4CEC5; Wed, 4 Sep 2024 19:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725479887; bh=64OvBJP69qJw6P7EgmSJroBGhOwbLbJG8IG6nSLkGmo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ovZsEM5XBjdsrWt30AE1FociPbENqzX695vAJVzCP9C6RzT2ZhOvOH0msKcWANTT2 amY8ez579Da94c2Z0OM0AJZG7Wc5APk45oW9bUhYoTAP7QsSCnMbbp0GhENvOpHwLx 1l2+BoY1f50rWX8E4N9uu9yG562deUhvRuONqjTg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-45004: KEYS: trusted: dcp: fix leak of blob encryption key Date: Wed, 4 Sep 2024 21:57:09 +0200 Message-ID: <2024090451-CVE-2024-45004-61b4@gregkh> X-Mailer: git-send-email 2.46.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=2705; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=64OvBJP69qJw6P7EgmSJroBGhOwbLbJG8IG6nSLkGmo=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk3djeHbZIxdeRKP9IdHn1mJUdErWfYjwWLxAyUNnwRW disXf+1I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZSfZ1hns6ViMuNgfqP2YSl Os17kr5X9N49wzA/eQPnZs4sQ/na0DOVif1X5uyTZ54PAA== 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: KEYS: trusted: dcp: fix leak of blob encryption key Trusted keys unseal the key blob on load, but keep the sealed payload in the blob field so that every subsequent read (export) will simply convert this field to hex and send it to userspace. With DCP-based trusted keys, we decrypt the blob encryption key (BEK) in the Kernel due hardware limitations and then decrypt the blob payload. BEK decryption is done in-place which means that the trusted key blob field is modified and it consequently holds the BEK in plain text. Every subsequent read of that key thus send the plain text BEK instead of the encrypted BEK to userspace. This issue only occurs when importing a trusted DCP-based key and then exporting it again. This should rarely happen as the common use cases are to either create a new trusted key and export it, or import a key blob and then just use it without exporting it again. Fix this by performing BEK decryption and encryption in a dedicated buffer. Further always wipe the plain text BEK buffer to prevent leaking the key via uninitialized memory. The Linux kernel CVE team has assigned CVE-2024-45004 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 2e8a0f40a39c and fixed in 6.10.7 with commit 9e3b266afcfe Issue introduced in 6.10 with commit 2e8a0f40a39c and fixed in 6.11-rc4 with commit 0e28bf61a5f9 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-45004 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: security/keys/trusted-keys/trusted_dcp.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/9e3b266afcfe4294e84496f50f006f029d3100db https://git.kernel.org/stable/c/0e28bf61a5f9ab30be3f3b4eafb8d097e39446bb