[PATCH 3/3] s390: add support for --reuse-cmdline

Sven Schnelle svens at linux.ibm.com
Tue Dec 7 08:12:42 PST 2021


Hi Philipp,

Philipp Rudo <prudo at redhat.com> writes:

>> diff --git a/kexec/arch/s390/kexec-image.c b/kexec/arch/s390/kexec-image.c
>> index dbeb689b830a..310d967ea331 100644
>> --- a/kexec/arch/s390/kexec-image.c
>> +++ b/kexec/arch/s390/kexec-image.c
>> @@ -72,6 +72,10 @@ int image_s390_load_file(int argc, char **argv, struct kexec_info *info)
>>  		case OPT_RAMDISK:
>>  			ramdisk = optarg;
>>  			break;
>> +		case OPT_REUSE_CMDLINE:
>> +			free(command_line);
>> +			command_line = get_command_line();
>
> get_command_line reads a maximum of 2048 bytes from /prc/cmdline. With
> the configurable size on s390 defaulting to 4096 bytes this will
> ultimately cause problems. So you need to make get_command_line more
> flexible first.

Thanks for pointing this out, i wasn't aware of that limitation. So we
likely want to change that to some dynamic allocation.

Sven



More information about the kexec mailing list