Alpha arch development list
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Magnus Lindholm <linmag7@gmail.com>
Cc: Richard Henderson <richard.henderson@linaro.org>,
	Matt Turner <mattst88@gmail.com>,
	linux-hardening@vger.kernel.org, linux-alpha@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] alpha: Replace strcpy() with strscpy() in setup_arch()
Date: Mon, 8 Sep 2025 15:23:40 +0200	[thread overview]
Message-ID: <99A381BA-47F7-410E-AC3C-D6EFA298DD5A@linux.dev> (raw)
In-Reply-To: <CA+=Fv5QdP-qGjUXQZ4ig1RX=0zx5c11gdrvwT9gqXNqTTqSZvA@mail.gmail.com>

Hi Magnus,

On 30. Aug 2025, at 21:11, Magnus Lindholm wrote:
> It can be a bit controversial to replace the platform specific string
> manipulation functions with a generic interface. On Alpha, there is nothing
> (at least to my knowledge) that indicates that strcpy is broken or used in
> an unsafe way and hence this patch doesn't really fix anything.
> In my opinion, I think this should be a NAK.

My patch doesn't fix anything, it simply replaces the deprecated
strcpy() with the safer strscpy(), without introducing any functional
changes.

I'm not sure whether the platform-specific strcpy() has any performance
benefits over the generic strscpy(), but setup_arch() is already using
strscpy() (converted from strlcpy() [1]) to copy the COMMAND_LINE string
to 'command_line'.

The current code feels unnecessarily inconsistent, with one line using
strscpy() and the next using the platform-specific strcpy().

Thanks,
Thorsten

[1] https://lore.kernel.org/all/20220818205936.6144-1-wsa+renesas@sang-engineering.com/


  reply	other threads:[~2025-09-08 13:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-17 23:17 [PATCH RESEND] alpha: Replace strcpy() with strscpy() in setup_arch() Thorsten Blum
2025-08-30 19:11 ` Magnus Lindholm
2025-09-08 13:23   ` Thorsten Blum [this message]
2025-09-09  8:04     ` Magnus Lindholm
  -- strict thread matches above, loose matches on Subject: below --
2025-07-16 21:11 Thorsten Blum
2025-06-19 14:58 Thorsten Blum
2025-05-21 12:20 Thorsten Blum

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=99A381BA-47F7-410E-AC3C-D6EFA298DD5A@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=linmag7@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox