Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933017Ab1BYXUy (ORCPT ); Fri, 25 Feb 2011 18:20:54 -0500 Received: from kroah.org ([198.145.64.141]:33420 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754899Ab1BYXUx (ORCPT ); Fri, 25 Feb 2011 18:20:53 -0500 Date: Fri, 25 Feb 2011 15:20:39 -0800 From: Greg KH To: Mike Waychison Cc: Olof Johansson , Andi Kleen , Alan Cox , Robert Lippert , Jon Mayer , Tony Luck , Duncan Laurie , Aaron Durbin , linux-kernel@vger.kernel.org, Tim Hockin , David Hendrix , linux-api@vger.kernel.org Subject: Re: [PATCH v2 6/5] Fix unaligned memory accesses in dmi-sysfs Message-ID: <20110225232039.GA10930@kroah.com> References: <20110223015307.13068.14063.stgit@mike.mtv.corp.google.com> <4D6835F1.2050304@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D6835F1.2050304@google.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1567 Lines: 41 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 > Tested-by: Tony Luck > --- > 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/