[PATCH] m68k: atari: Reject bare switches parameter
From: Thorsten Blum
Date: Fri Nov 06 2026 - 18:29:07 EST
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@xxxxxxxxxxxxxxx
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
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;