- Subject: Re: [PATCH v2 6/5] Fix unaligned memory accesses in dmi-sysfs
- From: Greg KH <greg@xxxxxxxxx>
- Date: Fri, 25 Feb 2011 15:20:39 -0800
- Cc: Olof Johansson <olofj@xxxxxxxxxxxx>, Andi Kleen <andi@xxxxxxxxxxxxxx>, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>, Robert Lippert <rlippert@xxxxxxxxxx>, Jon Mayer <jonmayer@xxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Duncan Laurie <dlaurie@xxxxxxxxxx>, Aaron Durbin <adurbin@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Tim Hockin <thockin@xxxxxxxxxx>, David Hendrix <dhendrix@xxxxxxxxxxxx>, linux-api@xxxxxxxxxxxxxxx
- In-reply-to: <4D6835F1.2050304@xxxxxxxxxx>
- References: <20110223015307.13068.14063.stgit@xxxxxxxxxxxxxxxxxxxxxxxx> <4D6835F1.2050304@xxxxxxxxxx>
- User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Feb 25, 2011 at 03:06:25PM -0800, Mike Waychison wrote:
> DMI entries are arranged in memory back to back with no alignment
> guarantees. This means that the struct dmi_header passed to callbacks
> from dmi_walk() itself isn't byte aligned. This causes problems on
> architectures that expect aligned data, such as IA64.
>
> The dmi-sysfs patchset introduced structure member accesses through
> this passed in dmi_header. Fix this by memcpy()ing the structures to
> temporary locations on stack when inspecting/copying them.
>
> Signed-off-by: Mike Waychison <mikew@xxxxxxxxxx>
> Tested-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
> dmi-sysfs.c | 28 +++++++++++++---------------
> 1 file changed, 13 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c
> index a5afd80..eb26d62 100644
> --- a/drivers/firmware/dmi-sysfs.c
> +++ b/drivers/firmware/dmi-sysfs.c
> @@ -263,20 +263,16 @@ struct dmi_system_event_log {
> u8 supported_log_type_descriptos[0];
> } __packed;
>
> -static const struct dmi_system_event_log *to_sel(const struct
> dmi_header *dh)
This patch is corrupted. I tried to edit it by hand, but git still
didn't like it.
Please resend using whatever you did for your other patches, as this way
was not correct :(
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Home]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]