mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>,
	barebox@lists.infradead.org,
	Sascha Hauer <s.hauer@pengutronix.de>
Subject: Re: [PATCH] filetype: fix unaligned access for x86_linux_bootimage
Date: Tue, 7 Apr 2026 09:50:30 +0200	[thread overview]
Message-ID: <230f6ac4-7540-4316-90ad-879fe5b8d855@pengutronix.de> (raw)
In-Reply-To: <20260407-v2026-03-1-topic-filetype-v1-1-e2fd029ab0d4@pengutronix.de>

On 4/7/26 09:34, Steffen Trumtrar wrote:
> is_x86_linux_bootimage tries to access an unaligned pointer which may
> lead to errors on SoCs that don't allow it (e.g. ARMv5)
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Thanks!
Ahmad

> ---
>  include/filetype.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/filetype.h b/include/filetype.h
> index d404e0cf3c..759ef9c2a3 100644
> --- a/include/filetype.h
> +++ b/include/filetype.h
> @@ -5,6 +5,7 @@
>  #include <linux/string.h>
>  #include <linux/types.h>
>  #include <asm/byteorder.h>
> +#include <asm/unaligned.h>
>  
>  /*
>   * List of file types we know
> @@ -170,7 +171,7 @@ static inline bool is_riscv_linux_bootimage(const void *header)
>  
>  static inline bool is_x86_linux_bootimage(const void *header)
>  {
> -	return le32_to_cpup(header + 0x202) == 0x53726448;
> +	return get_unaligned_le32(header + 0x202) == 0x53726448;
>  }
>  
>  #endif /* __FILE_TYPE_H */
> 
> ---
> base-commit: 1d386a53086d28a0c4eda138ae9408a418b97b7e
> change-id: 20260407-v2026-03-1-topic-filetype-1255d131e636
> 
> Best regards,
> --  
> Steffen Trumtrar <s.trumtrar@pengutronix.de>
> 
> 
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2026-04-07  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07  7:34 Steffen Trumtrar
2026-04-07  7:50 ` Ahmad Fatoum [this message]
2026-04-13  7:32 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=230f6ac4-7540-4316-90ad-879fe5b8d855@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s.trumtrar@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox