Skip to contentSkip to conversation

ARM: DRA7xx: Fix memory allocation overflow

PATCH In review Andrew F. Davis 2 participants 3 messages Feb 15, 2017 – Feb 17, 2017 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: DRA7xx: Fix memory allocation overflow

When using early malloc the allocated memory can overflow into the SRAM scratch space, move NON_SECURE_SRAM_IMG_END down a bit to allow more dynamic allocation at the expense of a slightly smaller maximum image size.

---
 arch/arm/include/asm/arch-omap5/omap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/arch-omap5/omap.h +1 -1
index b5e5519fbd..8f31da1a7b 100644
@@ -188,7 +188,7 @@ struct s32ktimer {
 #if defined(CONFIG_DRA7XX)
 #define NON_SECURE_SRAM_START	0x40300000
 #define NON_SECURE_SRAM_END	0x40380000	/* Not inclusive */
-#define NON_SECURE_SRAM_IMG_END	0x4037E000
+#define NON_SECURE_SRAM_IMG_END	0x4037C000
 #else
 #define NON_SECURE_SRAM_START	0x40300000
 #define NON_SECURE_SRAM_END	0x40320000	/* Not inclusive */
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 ARM: DRA7xx: Fix memory allocation overflow

Quoted 7 lines · Andrew F. Davis

When using early malloc the allocated memory can overflow into the SRAM scratch space, move NON_SECURE_SRAM_IMG_END down a bit to allow more dynamic allocation at the expense of a slightly smaller maximum image size.

Er, I thought we could define how big the early malloc pool is and not have this type of problem?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170215/757ee972/attachment.sig>
#2 lore raw
In reply to Andrew F. Davis
Quoted 7 lines · Andrew F. Davis

When using early malloc the allocated memory can overflow into the SRAM scratch space, move NON_SECURE_SRAM_IMG_END down a bit to allow more dynamic allocation at the expense of a slightly smaller maximum image size.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170217/5f801544/attachment.sig>