From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/2] RISC-V: start: align uncompressed DTB size to 4 bytes
Date: Fri, 17 May 2024 08:22:25 +0200 [thread overview]
Message-ID: <20240517062225.3302101-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240517062225.3302101-1-a.fatoum@pengutronix.de>
On ARM, I ran into a KASAN splat, because the uncompressed DT may not
have a 4-byte aligned size. This can affect RISC-V boards too, so import
the fix done there.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/riscv/boot/start.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/boot/start.c b/arch/riscv/boot/start.c
index 92991d0f6a84..d20526293bac 100644
--- a/arch/riscv/boot/start.c
+++ b/arch/riscv/boot/start.c
@@ -54,7 +54,7 @@ void *barebox_riscv_boot_dtb(void)
pr_debug("%s: using compressed_dtb\n", __func__);
- dtb = malloc(compressed_dtb->datalen_uncompressed);
+ dtb = malloc(ALIGN(compressed_dtb->datalen_uncompressed, 4));
if (!dtb)
return NULL;
--
2.39.2
next prev parent reply other threads:[~2024-05-17 6:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 6:22 [PATCH master 1/2] ARM: cpu: " Ahmad Fatoum
2024-05-17 6:22 ` Ahmad Fatoum [this message]
2024-05-21 7:15 ` 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=20240517062225.3302101-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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