Re: [PATCH v3 05/10] crash_dump: Free temporary dm-crypt keys_header buffer in kdump kernel

Sourabh Jain <[email protected]>
Newsgroups org.infradead.lists.kexec,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

On 29/07/26 09:06, Coiby Xu wrote:
> Although we expect the system to reboot immediately after vmcore dumping
> is finished, it's still good to free the temporary keys_header buffer.
>
> Fixes: 62f17d9df692 ("crash_dump: retrieve dm crypt keys in kdump kernel")
> Reported-by: Sourabh Jain <[email protected]>
> Signed-off-by: Coiby Xu <[email protected]>
> ---
>   kernel/crash_dump_dm_crypt.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/kernel/crash_dump_dm_crypt.c b/kernel/crash_dump_dm_crypt.c
> index a3996208738b..9a64e2d6841b 100644
> --- a/kernel/crash_dump_dm_crypt.c
> +++ b/kernel/crash_dump_dm_crypt.c
> @@ -117,6 +117,7 @@ static int get_keys_from_kdump_reserved_memory(void)
>   
>   static int restore_dm_crypt_keys_to_thread_keyring(void)
>   {
> +	struct keys_header *keys_header __free(kfree_sensitive) = NULL;
>   	struct dm_crypt_key *key;
>   	size_t keys_header_size;
>   	key_ref_t keyring_ref;

Yeah, it's good to release the memory regardless.

Feel free to add:
Reviewed-by: Sourabh Jain <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.