Re: [Fedora kexec-tools 1/7] kexec: x86: struct x86_linux_param_header should be packed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/04/13 at 09:56pm, Vivek Goyal wrote:
> I think struct x86_linux_param_header should be packed. Strange that we
> did not do it so far.
> 
> Without packing struct size was 3824 (decimal) on my x86_64 machine. With
> packing it is 3820. I think there was a padding of 4 bytes at the end. So
> it should be harmless.
> 
> I tried to introduce more fields and that introduced padding in the
> middle of structure and kexec stopped working and that's how I got to
> know that bootparam is not packed.
> 
> Signed-off-by: Vivek Goyal <vgoyal@xxxxxxxxxx>

Yes, it should be packed. This patch looks good to me.

Acked-by: WANG Chao <chaowang@xxxxxxxxxx>

> ---
>  include/x86/x86-linux.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/x86/x86-linux.h b/include/x86/x86-linux.h
> index 0949dc2..5f8f4b6 100644
> --- a/include/x86/x86-linux.h
> +++ b/include/x86/x86-linux.h
> @@ -198,7 +198,7 @@ struct x86_linux_param_header {
>  	struct 	edd_info eddbuf[EDDMAXNR];	/* 0xd00 */
>  						/* 0xeec */
>  #define COMMAND_LINE_SIZE 2048
> -};
> +} __attribute__ ((packed));
>  
>  struct x86_linux_faked_param_header {
>  	struct x86_linux_param_header hdr;	/* 0x00 */
> -- 
> 1.8.3.1
> 
> _______________________________________________
> kexec mailing list
> kexec@xxxxxxxxxxxxxxxxxxxxxxx
> https://lists.fedoraproject.org/mailman/listinfo/kexec
_______________________________________________
kernel mailing list
kernel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/kernel





[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux