]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KEYS: trusted: dcp: fix improper sg use with CONFIG_VMAP_STACK=y
authorDavid Gstir <david@sigma-star.at>
Wed, 13 Nov 2024 21:27:54 +0000 (22:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2025 09:05:09 +0000 (10:05 +0100)
commit3192f1c54dddb9b5820bf5e8677809949d8e9c66
treebea10d02ac3dfc7fbe236684cf3fd42f61529dd1
parentddfc234761a41c587ae71ab74114d5c133b6c827
KEYS: trusted: dcp: fix improper sg use with CONFIG_VMAP_STACK=y

commit e8d9fab39d1f87b52932646b2f1e7877aa3fc0f4 upstream.

With vmalloc stack addresses enabled (CONFIG_VMAP_STACK=y) DCP trusted
keys can crash during en- and decryption of the blob encryption key via
the DCP crypto driver. This is caused by improperly using sg_init_one()
with vmalloc'd stack buffers (plain_key_blob).

Fix this by always using kmalloc() for buffers we give to the DCP crypto
driver.

Cc: stable@vger.kernel.org # v6.10+
Fixes: 0e28bf61a5f9 ("KEYS: trusted: dcp: fix leak of blob encryption key")
Signed-off-by: David Gstir <david@sigma-star.at>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/keys/trusted-keys/trusted_dcp.c