Re: [PATCH v6 1/7] kexec_file: allow to place kexec_buf randomly

Coiby Xu
2024-12-02T10:05:17Z

On Fri, Nov 29, 2024 at 09:38:58AM +0800, Baoquan He wrote:
>On 10/29/24 at 01:52pm, Coiby Xu wrote:
>> Currently, kexec_buf is placed in order which means for the same
>> machine, the info in the kexec_buf is always located at the same
>> position each time the machine is booted. This may cause a risk for
>> sensitive information like LUKS volume key. Now struct kexec_buf has a
>> new field random which indicates it's supposed to be placed in a random
>> position.
>
>This change the generic code, but you don't mention this only takes
>effect in kdump case, won't impact kexec reboot case. I got this from
>code, while this should be mentioned in log.

Thanks for the reminder! I'll put a note in the commit msg.

>
[...]
>> +
>> +#ifdef CONFIG_CRASH_DUMP
>> +static inline void kexec_random_start(unsigned long start, unsigned long end,
> ~~~~~~~~~~~~~~~~~~
>This function name is very confusing. I thought it's a starting to
>randomize at the first glance, then realized it's to randomize the
>starting position of range.

Thanks for raising this concern! I'll rename it to
kexec_random_range_start.

--
Best regards,
Coiby