From: Maxim Suhanov Date: Tue, 4 Mar 2025 12:27:59 +0000 (+0300) Subject: disk/cryptodisk: Wipe the passphrase from memory X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbc0eb5bd1f40de9b394e3a86e84f46c39a23e40;p=thirdparty%2Fgrub.git disk/cryptodisk: Wipe the passphrase from memory Switching to another EFI boot application while there are secrets in RAM is dangerous, because not all firmware is wiping memory on free. To reduce the attack surface, wipe the passphrase acquired when unlocking an encrypted volume. Signed-off-by: Maxim Suhanov Reviewed-by: Daniel Kiper --- diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index 544a30d61..7065bcdcb 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c @@ -1302,6 +1302,7 @@ grub_cryptodisk_scan_device_real (const char *name, if (askpass) { + grub_memset (cargs->key_data, 0, cargs->key_len); cargs->key_len = 0; grub_free (cargs->key_data); }