lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=dE5_VjJ+5H6cWf9nAtdkLiqhSXo6Gvd_uGQ25@mail.gmail.com>
Date:	Wed, 23 Feb 2011 13:29:46 -0800
From:	Tony Luck <tony.luck@...el.com>
To:	Mike Waychison <mikew@...gle.com>
Cc:	Greg KH <greg@...ah.com>, Olof Johansson <olofj@...omium.org>,
	Andi Kleen <andi@...stfloor.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Robert Lippert <rlippert@...gle.com>,
	Jon Mayer <jonmayer@...gle.com>,
	Duncan Laurie <dlaurie@...gle.com>,
	Aaron Durbin <adurbin@...gle.com>,
	linux-kernel@...r.kernel.org, Tim Hockin <thockin@...gle.com>,
	David Hendrix <dhendrix@...omium.org>,
	linux-api@...r.kernel.org
Subject: Re: [PATCH v2 2/5] firmware: Basic dmi-sysfs support

On Wed, Feb 23, 2011 at 12:28 PM, Mike Waychison <mikew@...gle.com> wrote:
> Ya, I don't think there is anything that guarantees that dmi_header is
> aligned.   The access is probably the struct copy I did here:
>
>        /* Set the key */
>        entry->dh = *dh;

Yup - looking back at the assembly I see that one of the 2-byte
accesses is offset 2
(picking up ->handle), but the second is offset 0 (picking up ->type
and ->length). The
compiler assumed the structure was 2-byte aligned because of ->handle.

> What if we changed that guy to use memcpy?  We'd probably need to
> memcpy the dmi_system_event_log as well.  Patch attached (applies on
> top of the entire patchset).

With the patch, all the unaligned accesses go away.

Tested-by: Tony Luck <tony.luck@...el.com>

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ