From: bfgithub@veryspeedy.net
To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org
Cc: Berto Furth <bfgithub@veryspeedy.net>
Subject: [PATCH v1 1/1] Set cmdline array size to COMMAND_LINE_SIZE
Date: Thu, 19 Aug 2021 12:21:46 +1000 [thread overview]
Message-ID: <20210819022144.22719-2-bfgithub@veryspeedy.net> (raw)
In-Reply-To: <20210819022144.22719-1-bfgithub@veryspeedy.net>
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 --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 */
--
2.32.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2021-08-19 2:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 2:21 [PATCH v1 0/1] ARM hangs on boot with CONFIG_FORTIFY_SOURCE and ATAGs bfgithub
2021-08-19 2:21 ` bfgithub [this message]
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=20210819022144.22719-2-bfgithub@veryspeedy.net \
--to=bfgithub@veryspeedy.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
/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 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.