From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XxfHc-0004PD-9B for mharc-grub-devel@gnu.org; Sun, 07 Dec 2014 12:06:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxfHW-0004P5-Eg for grub-devel@gnu.org; Sun, 07 Dec 2014 12:06:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxfHR-0006Vw-R8 for grub-devel@gnu.org; Sun, 07 Dec 2014 12:06:02 -0500 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:55810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxfHR-0006Vd-Dc for grub-devel@gnu.org; Sun, 07 Dec 2014 12:05:57 -0500 Received: by mail-wg0-f54.google.com with SMTP id l2so4519109wgh.13 for ; Sun, 07 Dec 2014 09:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=lYpPqSe405ysMt6u+kojWKZOYfd6HTfALgyIAwiLmqo=; b=ahSncBFEtBEXYSLKu7MyCZbReH7NaI7XfaDaY+wKlgohZ+SGCUQO0bbx25qH9mn+eB onUuRkgJjNefexZhuzWnupbKLdSX2DH0XUkzpriw8L79ZHFmUqC5vXAdeYwWe+IsLtYu nB5G/mC2emYNAgduvuC2WVSxzS6mwUc7dkOhdwMouZ9BSSKAA8DI0c+huNHHQXPrpo8P 5xb9IjZxT77YDralryV9GXHg5iJl3MR96HL9Q/hcWIYOH6sMuL9JONsrWRHFI7/WJ2Ct fLupCWrkgJkw9x5uesDQ2n4dmFSY2io2nh8PLrMzkzDs0dFnH19agPlUmlQe0uv7WccQ 1TlA== X-Received: by 10.194.185.115 with SMTP id fb19mr39588048wjc.121.1417971956815; Sun, 07 Dec 2014 09:05:56 -0800 (PST) Received: from [192.168.42.216] (130-226.197-178.cust.bluewin.ch. [178.197.226.130]) by mx.google.com with ESMTPSA id h8sm6439326wiy.17.2014.12.07.09.05.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Dec 2014 09:05:55 -0800 (PST) Message-ID: <548488D7.7080008@gmail.com> Date: Sun, 07 Dec 2014 18:05:27 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable References: <20141125114357.GD2361@bivouac.eciton.net> <20141127172521.2d8992bd@opensuse.site> In-Reply-To: <20141127172521.2d8992bd@opensuse.site> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="372OjPAjkxBhDgdEBqMu5oLo4vregp3S7" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::236 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2014 17:06:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --372OjPAjkxBhDgdEBqMu5oLo4vregp3S7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Please commit and push. On 27.11.2014 15:25, Andrei Borzenkov wrote: > =D0=92 Tue, 25 Nov 2014 11:43:57 +0000 > Leif Lindholm =D0=BF=D0=B8=D1=88=D0=B5=D1=82= : >=20 >> On Thu, Nov 20, 2014 at 09:53:14PM +0100, David Kozub wrote: >>> The unaligned local in __aeabi_uidivmod leads to a store to a 64bit >>> value at an address that is not divisible by 8 (in grub_divmod64). >>> The compiler most likely generates a STRD instruction to store it and= >>> this causes an exception. >>> >>> Fixes Savannah bug #43632. >> >> I agree with this patch - am I OK to push? >=20 > Yes, you are the best expert here. >=20 >> >> / >> Leif >> =20 >>> This includes improvements done by Leif Lindholm. >>> --- >>> ChangeLog | 6 ++++++ >>> grub-core/kern/arm/misc.S | 14 +++++++------- >>> 2 files changed, 13 insertions(+), 7 deletions(-) >>> >>> diff --git a/ChangeLog b/ChangeLog >>> index 6fbec06..8728c04 100644 >>> --- a/ChangeLog >>> +++ b/ChangeLog >>> @@ -1,3 +1,9 @@ >>> +2014-11-21 David Kozub >>> + >>> + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable >>> + in __aeabi_uidivmod >>> + Fixes Savannah bug #43632. >>> + >>> 2014-11-20 Andrei Borzenkov >>> =20 >>> * tests/util/grub-fs-tester.in: Consistently print output >>> diff --git a/grub-core/kern/arm/misc.S b/grub-core/kern/arm/misc.S >>> index 8943cc3..16b6f8e 100644 >>> --- a/grub-core/kern/arm/misc.S >>> +++ b/grub-core/kern/arm/misc.S >>> @@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) >>> =20 >>> .macro division parent >>> =20 >>> - stmfd sp!, {lr} >>> - sub sp, sp, #12 >>> + sub sp, sp, #8 @ Allocate naturally aligned 64-bit = space >>> + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignme= nt >>> + add r3, sp, #8 @ Set r3 to address of 64-bit space >>> + str r3, [sp] @ Stack parameter, pointer to 64-bit= space >>> mov r2, r1 >>> - add r1, sp, #4 >>> - str r1, [sp, #0] >>> mov r1, #0 >>> mov r3, #0 >>> bl \parent >>> - ldr r1, [sp, #4] >>> - add sp, sp, #12 >>> - ldmfd sp!, {lr} >>> + ldr r1, [sp, #8] @ Extract remainder >>> + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch reg= ister >>> + add sp, sp, #8 >>> bx lr >>> .endm >>> =20 >>> --=20 >>> 2.1.1 >>> >>> >>> _______________________________________________ >>> Grub-devel mailing list >>> Grub-devel@gnu.org >>> https://lists.gnu.org/mailman/listinfo/grub-devel >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --372OjPAjkxBhDgdEBqMu5oLo4vregp3S7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlSEiNcACgkQmBXlbbo5nOtpLwD+Nr2yjvOluaSSLDa6VU0JkquX Y5rqTxxGipD6f55FQHYA/j3nhYJE0uellANyjJTmh0YpE6vkCgpQLpxlPcyBQOPN =mcA5 -----END PGP SIGNATURE----- --372OjPAjkxBhDgdEBqMu5oLo4vregp3S7--