public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <sergei.shtylyov@gmail.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/8] MIPS: malta-init: bound default console command-line append
Date: Sun, 5 Apr 2026 19:08:40 +0300	[thread overview]
Message-ID: <c4d0542d-c442-4ad7-bf8e-33eb2e643e3d@gmail.com> (raw)
In-Reply-To: <20260405102007.7-mips-cmdline-pengpeng@iscas.ac.cn>

On 4/4/26 5:06 PM, Pengpeng Hou wrote:

> console_config() appends a synthesized console= option to fw_getcmdline()
> with unchecked strcat() when the firmware command line does not already
> provide one. If the existing command line is near full, that append can
> overflow the fixed command-line buffer.
> 
> Switch the default console append to bounded concatenation.
> 
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
>  arch/mips/mti-malta/malta-init.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
> index 82b0fd8576a2..fb782b1a3f6e 100644
> --- a/arch/mips/mti-malta/malta-init.c
> +++ b/arch/mips/mti-malta/malta-init.c
> @@ -78,13 +78,14 @@ static void __init console_config(void)
>  		setup_earlycon(console_string);
>  	}
>  
> -	if ((strstr(fw_getcmdline(), "console=")) == NULL) {
> -		sprintf(console_string, " console=ttyS0,%d%c%c%c", baud,
> -			parity, bits, flow);
> -		strcat(fw_getcmdline(), console_string);
> -		pr_info("Config serial console:%s\n", console_string);
> +	if ((strstr(fw_getcmdline(), "console=")) == NULL) {
> +		sprintf(console_string, " console=ttyS0,%d%c%c%c", baud,
> +			parity, bits, flow);

   I don't quit understand what changed in the above 3 lines...

> +		strlcat(fw_getcmdline(), console_string,
> +			COMMAND_LINE_SIZE);
> +		pr_info("Config serial console:%s\n", console_string);
> +	}
>  	}
> -}

   Huh? :-)

>  #endif

MBR, Sergey


  reply	other threads:[~2026-04-05 16:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-05  2:20 [PATCH 0/8] MIPS: bound early command-line construction Pengpeng Hou
2026-04-04 14:06 ` [PATCH 1/8] MIPS: dec: bound PROM command-line appends Pengpeng Hou
2026-04-04 14:06 ` [PATCH 3/8] MIPS: lemote-2f: bound machtype command-line append Pengpeng Hou
2026-04-04 14:06 ` [PATCH 2/8] MIPS: sni: bound PROM command-line appends Pengpeng Hou
2026-04-04 14:06 ` [PATCH 5/8] MIPS: arc: bound firmware command-line construction Pengpeng Hou
2026-04-04 14:06 ` [PATCH 4/8] MIPS: txx9: bound command-line reconstruction Pengpeng Hou
2026-04-04 14:06 ` [PATCH 6/8] MIPS: cavium-octeon: bound default console command-line append Pengpeng Hou
2026-04-04 14:06 ` [PATCH 8/8] MIPS: malta-setup: bound pci_clock " Pengpeng Hou
2026-04-04 14:06 ` [PATCH 7/8] MIPS: malta-init: bound default console " Pengpeng Hou
2026-04-05 16:08   ` Sergey Shtylyov [this message]
2026-04-06  5:30   ` Pengpeng Hou

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=c4d0542d-c442-4ad7-bf8e-33eb2e643e3d@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=pengpeng@iscas.ac.cn \
    --cc=tsbogend@alpha.franken.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox