[PATCH] Fix module module_init/init_size offsets for v4.5 kernel

Atsushi Kumagai ats-kumagai at wm.jp.nec.com
Thu Oct 27 23:36:51 PDT 2016


Hello Kamalesh and Pratyush,

>On Friday 28 October 2016 10:37 AM, Kamalesh Babulal wrote:
>> Kernel commit 7523e4dc50 (module: use a structure to encapsulate layout.)
>> encapsulates core_layout and init_layout into module_layout structure.
>>
>> commit fa6a75a93 (Fix module core base and size offset for kernel v4.5)
>> fixes offset value calculation for core layout's base and size, whereas
>> Kernel v4.5 module changes also needs fixing of module init_size and
>> module_init for the makedumpfile to read the correct module address.
>>
>> This patch fixes calculation of offsets values for module init_size and
>> module_init.
>>
>> Signed-off-by: Kamalesh Babulal <kamalesh at linux.vnet.ibm.com>
>> Cc: Pratyush Anand <panand at redhat.com>
>
>Reviewed-by: Pratyush Anand <panand at redhat.com>

Thanks, but I think Guenther posted the same fix which you can see
in the devel branch:

commit 32dd46803944959f78e01e7c4847c465efca99a6
Author: Guenther Hutzl <hutzl at linux.vnet.ibm.com>
Date:   Wed Jul 6 20:00:54 2016 +0900

    [PATCH] Fix module init base and size offset for kernel v4.5

    This is a follow-up patch on the patch provided in post:

    "[PATCH] makedumpfile: fix module core base and size offset for kernel v4.5"
    by Pratyush Anand


Thanks,
Atsushi Kumagai


>> ---
>>  makedumpfile.c | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/makedumpfile.c b/makedumpfile.c
>> index 853b999..f33a90d 100644
>> --- a/makedumpfile.c
>> +++ b/makedumpfile.c
>> @@ -1689,7 +1689,25 @@ get_structure_info(void)
>>  		OFFSET(module.core_size) += core_layout;
>>  	}
>>  	OFFSET_INIT(module.module_init, "module", "module_init");
>> +	if (OFFSET(module.module_init) == NOT_FOUND_STRUCTURE) {
>> +		/* for kernel version 4.5 and above */
>> +		long init_layout;
>> +
>> +		OFFSET_INIT(module.module_init, "module", "init_layout");
>> +		init_layout = OFFSET(module.module_init);
>> +		OFFSET_INIT(module.module_init, "module_layout", "base");
>> +		OFFSET(module.module_init) += init_layout;
>> +	}
>>  	OFFSET_INIT(module.init_size, "module", "init_size");
>> +	if (OFFSET(module.init_size) == NOT_FOUND_STRUCTURE) {
>> +		/* for kernel version 4.5 and above */
>> +		long init_layout;
>> +
>> +		OFFSET_INIT(module.init_size, "module", "init_layout");
>> +		init_layout = OFFSET(module.init_size);
>> +		OFFSET_INIT(module.init_size, "module_layout", "size");
>> +		OFFSET(module.init_size) += init_layout;
>> +	}
>>
>>  	ENUM_NUMBER_INIT(NR_FREE_PAGES, "NR_FREE_PAGES");
>>  	ENUM_NUMBER_INIT(N_ONLINE, "N_ONLINE");
>>
>
>_______________________________________________
>kexec mailing list
>kexec at lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/kexec



More information about the kexec mailing list