mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] m68k: atari: Reject bare switches parameter
@ 2026-11-06 23:24 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-11-06 23:24 UTC (permalink / raw)
  To: Geert Uytterhoeven, Thorsten Blum, Michael Schmitz,
	Miro Kropacek, Roman Zippel
  Cc: linux-m68k, linux-kernel

When a bare switches parameter is specified on the kernel command line
without the '=' separator, early parameter parsing passes NULL to
atari_switches_setup(), which then attempts to copy data from address
zero to the local switches buffer.

Reject a NULL argument in atari_switches_setup() by returning -EINVAL so
early parameter parsing reports the malformed option instead.

Fixes: d6713b4091a9 ("m68k: early parameter support")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/m68k/atari/config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index bdafc86241b7..b82bbf93d8e7 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -149,6 +149,9 @@ static int __init atari_switches_setup(char *str)
 	if (!MACH_IS_ATARI)
 		return 0;
 
+	if (!str)
+		return -EINVAL;
+
 	/* copy string to local array, strsep works destructively... */
 	strcpy(switches, str);
 	atari_switches = 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-06 23:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 23:24 [PATCH] m68k: atari: Reject bare switches parameter Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®