m68k: atari: Reject bare switches parameter
PATCH 1/1 m68k: atari: Reject bare switches parameter
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")
Signed-off-by Thorsten Blum <[email protected]>
--- arch/m68k/atari/config.c | 3 +++ 1 file changed, 3 insertions(+)
arch/m68k/atari/config.c +3 -0
@@ -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 ;