]> git.ipfire.org Git - thirdparty/grub.git/commit
cryptodisk: Wipe out the cached keys from protectors
authorGary Lin <glin@suse.com>
Fri, 15 Nov 2024 07:34:57 +0000 (15:34 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 28 Nov 2024 20:50:56 +0000 (21:50 +0100)
commitb35480b48e6f9506d8b7ad8a3b5206d29c24ea95
tree9227977141159544362df3400d1b67d0e2cf2b84
parent6abf8af3c54abc04c4ec71c75d10fcfbc190e181
cryptodisk: Wipe out the cached keys from protectors

An attacker may insert a malicious disk with the same crypto UUID and
trick GRUB to mount the fake root. Even though the key from the key
protector fails to unlock the fake root, it's not wiped out cleanly so
the attacker could dump the memory to retrieve the secret key. To defend
such attack, wipe out the cached key when we don't need it.

Cc: Fabian Vogt <fvogt@suse.com>
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
grub-core/disk/cryptodisk.c