All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <blum@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Thorsten Blum <blum@kernel.org>,
	Michael Schmitz <schmitzmic@gmail.com>,
	Miro Kropacek <miro.kropacek@gmail.com>,
	Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: [PATCH] m68k: atari: Reject bare switches parameter
Date: Sat,  7 Nov 2026 00:24:03 +0100	[thread overview]
Message-ID: <20261106232402.278217-3-blum@kernel.org> (raw)

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;

                 reply	other threads:[~2026-11-06 23:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261106232402.278217-3-blum@kernel.org \
    --to=blum@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=miro.kropacek@gmail.com \
    --cc=schmitzmic@gmail.com \
    --cc=zippel@linux-m68k.org \
    /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.