From: Alejandro Colomar <alx@kernel.org>
To: Greg KH <greg@kroah.com>
Cc: Alejandro Colomar <alx+linux-hardening@kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Shihuang Liu <shlomojune6@gmail.com>,
linux-input@vger.kernel.org, linux-hardening@vger.kernel.org,
Marcus Folkesson <marcus.folkesson@gmail.com>,
Ville Syrjala <syrjala@sci.fi>,
Henk Vergonet <Henk.Vergonet@gmail.com>,
Henrik Rydberg <rydberg@bitmath.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] Input: joystick - replace strlcat() with strscpy()
Date: Mon, 19 Oct 2026 18:40:56 +0200 [thread overview]
Message-ID: <atZHH60l9JAkLl2D@debian> (raw)
In-Reply-To: <2026101951-undusted-laziness-d40f@gregkh>
[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]
Hi Greg,
> Date: 2026-10-19 10:44:22+0200
> From: Greg KH <greg@kroah.com>
>
[...]
> > > I'm all for that too, and putting it in the USB core for everyone to use
> > > would be great.
> >
> > You might be interested in <https://lore.kernel.org/linux-hardening/cover.1751747518.git.alx@kernel.org/>.
> > I was working on something like that, but actually much simpler.
> > It is meant to replace strscpy()/snprintf() by versions more similar to
> > Plan9's strecpy(2)/seprint(2), but without some important flaw that the
> > Plan9 APIs have (about handling NULL).
>
> Look at the patches from Kees on the hardening list for the seqbuf
> stuff, that ideally will replace these types of string functions
> entirely over time.
I have looked at them. I personally think some of them are a bit
unnecessarily complex, by being designed around lengths instead of
offset pointers.
Essentially, his API is a wrapper around the usual strscpy()/snprintf(3)
operations, but because those fundamental operations are themselves
flawed, their wrapper is inherently flawed too. stpecpy()/seprintf()
are the same, but are simpler to use raw, and by being simpler to use,
their wrappers would naturally because also simpler.
I'm trying to convince Kees of this. :-)
Have a lovely night!
Alex
>
> thanks,
>
> greg k-h
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-10-19 16:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 17:04 [PATCH 0/5] Input: replace strlcat() with strscpy() in USB input drivers Shihuang Liu
2026-10-16 17:04 ` [PATCH 1/5] Input: joystick - replace strlcat() with strscpy() Shihuang Liu
2026-10-16 19:17 ` Dmitry Torokhov
2026-10-17 8:19 ` Greg KH
2026-10-18 16:02 ` Shihuang Liu
2026-10-19 7:51 ` Alejandro Colomar
2026-10-19 8:44 ` Greg KH
2026-10-19 16:40 ` Alejandro Colomar [this message]
2026-10-16 17:04 ` [PATCH 2/5] Input: misc " Shihuang Liu
2026-10-19 7:48 ` Alejandro Colomar
2026-10-19 17:08 ` Shihuang Liu
2026-10-16 17:04 ` [PATCH 3/5] Input: mouse " Shihuang Liu
2026-10-16 17:04 ` [PATCH 4/5] Input: tablet " Shihuang Liu
2026-10-17 22:11 ` David Laight
2026-10-16 17:04 ` [PATCH 5/5] Input: touchscreen " Shihuang Liu
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=atZHH60l9JAkLl2D@debian \
--to=alx@kernel.org \
--cc=Henk.Vergonet@gmail.com \
--cc=alx+linux-hardening@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=greg@kroah.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcus.folkesson@gmail.com \
--cc=rydberg@bitmath.org \
--cc=shlomojune6@gmail.com \
--cc=syrjala@sci.fi \
/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
all inboxes | Powered by JetHome®