[Makedumpfile PATCH v3 1/2] makedumpfile: add runtime kaslr offset if it exists

Atsushi Kumagai ats-kumagai at wm.jp.nec.com
Thu May 25 18:47:28 PDT 2017


>>> diff --git a/makedumpfile.c b/makedumpfile.c
>>> index 301772a8820c..4986d098d69a 100644
>>> --- a/makedumpfile.c
>>> +++ b/makedumpfile.c
>>> @@ -2099,6 +2099,13 @@ void
>>> write_vmcoreinfo_data(void)
>>> {
>>> 	/*
>>> +	 * write 1st kernel's KERNELOFFSET
>>> +	 */
>>> +	if (info->kaslr_offset)
>>> +		fprintf(info->file_vmcoreinfo, "%s%lx\n", STR_KERNELOFFSET,
>>> +		    info->kaslr_offset);
>>
>> When will this data written to VMCOREINFO file be used ?
>> info->kaslr_offset is necessary for vmlinux but -x and -i are exclusive.
>
>This is what I thought:
>
>Lets says we have got a vmcore1 after re-filtering original vmcore. Now, if we
>would like to re-filter vmcore1 then we will need kaslr_offset again. So,
>should we not right kaslr_offset in vmcoreinfo of vmcore1 as well?

write_vmcoreinfo_data() is called only for -g option, it makes a
VMCOREINFO file as a separate file, it doesn't overwrite VMCOREINFO in vmcore.

  if (info->flag_generate_vmcoreinfo)
    generate_vmcoreinfo()
      + write_vmcoreinfo_data()

find_kaslr_offsets() doesn't refer to the separate VMCOREINFO file,
writing STR_KERNELOFFSET in it is meaningless.


Thanks,
Atsushi Kumagai




More information about the kexec mailing list