All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi_loader: use byteshift unaligned access helper
@ 2021-11-03  2:04 Masahisa Kojima
  2021-11-03  6:23 ` Ilias Apalodimas
  0 siblings, 1 reply; 2+ messages in thread
From: Masahisa Kojima @ 2021-11-03  2:04 UTC (permalink / raw)
  To: u-boot
  Cc: Heinrich Schuchardt, Ilias Apalodimas, Simon Glass,
	Masahisa Kojima, Alexander Graf

Calling unaligned/access-ok.h version of put_unaligned_le64()
causes data abort in arm 32-bit QEMU.

The similar issue also occurs in linux kernel,
unaligned/access-ok.h is no longer used in linux kernel[1].

This commit uses the unaligned/be_byteshift.h and
unaligned/le_byteshift.h helper instead of unaligned/access-ok.h.

[1]https://lore.kernel.org/all/20210507220813.365382-8-arnd@kernel.org/

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
---
 lib/efi_loader/efi_tcg2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index cb67006b14..b34d383a7d 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -22,7 +22,8 @@
 #include <u-boot/sha1.h>
 #include <u-boot/sha256.h>
 #include <u-boot/sha512.h>
-#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/le_byteshift.h>
 #include <linux/unaligned/generic.h>
 #include <hexdump.h>
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] efi_loader: use byteshift unaligned access helper
  2021-11-03  2:04 [PATCH] efi_loader: use byteshift unaligned access helper Masahisa Kojima
@ 2021-11-03  6:23 ` Ilias Apalodimas
  0 siblings, 0 replies; 2+ messages in thread
From: Ilias Apalodimas @ 2021-11-03  6:23 UTC (permalink / raw)
  To: Masahisa Kojima; +Cc: u-boot, Heinrich Schuchardt, Simon Glass, Alexander Graf

On Wed, Nov 03, 2021 at 11:04:09AM +0900, Masahisa Kojima wrote:
> Calling unaligned/access-ok.h version of put_unaligned_le64()
> causes data abort in arm 32-bit QEMU.
> 
> The similar issue also occurs in linux kernel,
> unaligned/access-ok.h is no longer used in linux kernel[1].
> 
> This commit uses the unaligned/be_byteshift.h and
> unaligned/le_byteshift.h helper instead of unaligned/access-ok.h.
> 
> [1]https://lore.kernel.org/all/20210507220813.365382-8-arnd@kernel.org/
> 
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> ---
>  lib/efi_loader/efi_tcg2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
> index cb67006b14..b34d383a7d 100644
> --- a/lib/efi_loader/efi_tcg2.c
> +++ b/lib/efi_loader/efi_tcg2.c
> @@ -22,7 +22,8 @@
>  #include <u-boot/sha1.h>
>  #include <u-boot/sha256.h>
>  #include <u-boot/sha512.h>
> -#include <linux/unaligned/access_ok.h>
> +#include <linux/unaligned/be_byteshift.h>
> +#include <linux/unaligned/le_byteshift.h>
>  #include <linux/unaligned/generic.h>
>  #include <hexdump.h>
>  
> -- 
> 2.17.1
> 

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-03  6:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03  2:04 [PATCH] efi_loader: use byteshift unaligned access helper Masahisa Kojima
2021-11-03  6:23 ` Ilias Apalodimas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.