diff mbox series

[v1,1/1] Set cmdline array size to COMMAND_LINE_SIZE

Message ID 20210819022144.22719-2-bfgithub@veryspeedy.net (mailing list archive)
State New, archived
Headers show
Series ARM hangs on boot with CONFIG_FORTIFY_SOURCE and ATAGs | expand

Commit Message

bfgithub@veryspeedy.net Aug. 19, 2021, 2:21 a.m. UTC
From: Berto Furth <bfgithub@veryspeedy.net>

Use maximum size in declaration of ATAG cmdline string.

The declaration of the cmdline string in the ATAG type tag_cmdline
uses an array size of 1. This means that the fortified versions of
string functions (like strlcpy) will panic when they see that the
actual contents of the cmdline string are bigger than 1 byte.

Fix is to simply indicate that the string can actually be up to
COMMAND_LINE_SIZE bytes by setting the array size as such.

Signed-off-by: Berto Furth <bfgithub@veryspeedy.net>
Tested-by: Berto Furth <bfgithub@veryspeedy.net>
---
 arch/arm/include/uapi/asm/setup.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/arm/include/uapi/asm/setup.h b/arch/arm/include/uapi/asm/setup.h
index 25ceda63b284..9c88c919467b 100644
--- a/arch/arm/include/uapi/asm/setup.h
+++ b/arch/arm/include/uapi/asm/setup.h
@@ -124,7 +124,7 @@  struct tag_videolfb {
 #define ATAG_CMDLINE	0x54410009
 
 struct tag_cmdline {
-	char	cmdline[1];	/* this is the minimum size */
+	char	cmdline[COMMAND_LINE_SIZE];
 };
 
 /* acorn RiscPC specific information */