All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Bill Wendling <morbo@google.com>
Cc: linux-kernel@vger.kernel.org,
	"Russell King" <linux@armlinux.org.uk>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"WANG Xuerui" <kernel@xen0n.name>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Helge Deller" <deller@gmx.de>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Ian Abbott" <abbotti@mev.co.uk>,
	"H Hartley Sweeten" <hsweeten@visionengravers.com>,
	"Tony Luck" <tony.luck@intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Matthias Schwarzott" <zzam@gentoo.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Tony Nguyen" <anthony.l.nguyen@intel.com>,
	"Przemek Kitszel" <przemyslaw.kitszel@intel.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Arend van Spriel" <arend.vanspriel@broadcom.com>,
	"Rob Herring" <robh@kernel.org>,
	"Saravana Kannan" <saravanak@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Peter Griffin" <peter.griffin@linaro.org>,
	"Alim Akhtar" <alim.akhtar@samsung.com>,
	"Linus Walleij" <linusw@kernel.org>,
	"Anil Gurumurthy" <anil.gurumurthy@qlogic.com>,
	"Sudarsana Kalluru" <sudarsana.kalluru@qlogic.com>,
	"Martin K. Petersen" <mkp@kernel.org>,
	"Trond Myklebust" <trondmy@kernel.org>,
	"Anna Schumaker" <anna@kernel.org>,
	"Mike Marshall" <hubcap@omnibond.com>,
	"Martin Brandenburg" <martin@omnibond.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Simon Horman" <horms@kernel.org>, "Chuck Lever" <cel@kernel.org>,
	"Jeff Layton" <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	"Olga Kornievskaia" <okorniev@redhat.com>,
	"Dai Ngo" <Dai.Ngo@oracle.com>, "Tom Talpey" <tom@talpey.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	"Kanglong Wang" <wangkanglong@loongson.cn>,
	"Tiezhu Yang" <yangtiezhu@loongson.cn>,
	"Qiang Ma" <maqianga@uniontech.com>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Pengpeng Hou" <pengpeng@iscas.ac.cn>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Breno Leitao" <leitao@debian.org>,
	"Thorsten Blum" <blum@kernel.org>,
	"Harshit Mogalapalli" <harshit.m.mogalapalli@oracle.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Lyude Paul" <lyude@redhat.com>,
	"Ashutosh Desai" <ashutoshdesai993@gmail.com>,
	"Imre Deak" <imre.deak@intel.com>,
	"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
	"Johan Hovold" <johan@kernel.org>,
	"Johannes Berg" <johannes.berg@intel.com>,
	"Miri Korenblit" <miriam.rachel.korenblit@intel.com>,
	"Alexander Stein" <alexander.stein@ew.tq-group.com>,
	"Cryolitia PukNgae" <cryolitia@uniontech.com>,
	"Jiaming Zhang" <r772577952@gmail.com>,
	"Will Porter" <mrwillporter@gmail.com>,
	"Cen Zhang" <zzzccc427@gmail.com>,
	"Cássio Gabriel" <cassiogabrielcontato@gmail.com>,
	"Rong Zhang" <i@rong.moe>,
	"Arun Raghavan" <arunr@valvesoftware.com>,
	nikitash.mariiaw@gmail.com, linux-arm-kernel@lists.infradead.org,
	loongarch@lists.linux.dev, linux-mips@vger.kernel.org,
	linux-parisc@vger.kernel.org, linux-edac@vger.kernel.org,
	dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	linux-input@vger.kernel.org, linux-media@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev,
	brcm80211-dev-list.pdl@broadcom.com, devicetree@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-nfs@vger.kernel.org,
	devel@lists.orangefs.org, linux-hardening@vger.kernel.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 00/28] Replace remaining strlcat() call sites with snprintf()/seq_buf()
Date: Tue, 15 Sep 2026 11:05:29 -0700	[thread overview]
Message-ID: <202609151055.AFC6267@keescook> (raw)
In-Reply-To: <20260915081910.4142719-1-morbo@google.com>

On Tue, Sep 15, 2026 at 08:18:17AM +0000, Bill Wendling wrote:
> strlcat() is deprecated: like strcat(), it requires re-scanning the
> destination string from the beginning on every call, which is O(n^2)
> when used to build up a string incrementally, and its truncation
> behavior is easy to get wrong. See:
> 
>   https://github.com/KSPP/linux/issues/370
> 
> This series removes the remaining strlcat() call sites in the tree
> (plus the one inside fortify-string.h's strcat() implementation
> itself), replacing each with snprintf(), scnprintf(), or the seq_buf()
> API, whichever best fits the surrounding code.

Thanks for tackling this!

A few global notes:

- This series almost certainly needs to be sent as separate single
  patches to each subsystem maintainer (rather than a giant CC list).

- As others noted already, we don't want to do anything as just an
  open-coded strlen/sprintf; this doesn't gain us anything. If we can't
  use seq_buf or some other solution, we need to figure out what we _can_
  do for a given use.

- There are some collisions with other in-flight patches, e.g.  Mariia's[1]

- The "Assisted-by:" trailer doesn't need the level of detail you've
  got, which changed recently[2]. Now the desired trailer would just be:
    Assisted-by: LLM

- Please avoid including the Cc list in the email body (above or below
  the "---" line), as it ends up being redundant.

I'll go look through the individual patches...

-Kees

[1] https://lore.kernel.org/all/27956255dde39f58d73a7b51cb53cbe3d7804f54.1786411026.git.mariianikitash@google.com/
[2] https://git.kernel.org/linus/816d9992d9ed ("coding-assistants: simplify attribution")

-- 
Kees Cook

      parent reply	other threads:[~2026-09-15 18:05 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  8:18 [PATCH 00/28] Replace remaining strlcat() call sites with snprintf()/seq_buf() Bill Wendling
2026-09-15  8:18 ` [PATCH 01/28] ALSA: ac97: Refactor snd_ac97_get_name() to use snprintf() Bill Wendling
2026-09-15 18:39   ` Kees Cook
2026-09-16  9:29     ` David Laight
2026-09-15  8:18 ` [PATCH 02/28] sunrpc: Refactor rpc_sockaddr2uaddr() to use snprintf() instead of strlcat() Bill Wendling
2026-09-15 10:17   ` Jeff Layton
2026-09-15  8:18 ` [PATCH 03/28] ARM: atags: Replace strlcat() with snprintf() for cmdline extend Bill Wendling
2026-09-15 19:00   ` Kees Cook
2026-09-16  8:28     ` Bill Wendling
2026-09-17  7:38   ` sashiko-bot
2026-09-15  8:18 ` [PATCH 04/28] scsi: bfa: Use snprintf() in bfa_fcs_fabric_nsymb_init() Bill Wendling
2026-09-17  7:38   ` sashiko-bot
2026-09-15  8:18 ` [PATCH 05/28] ALSA: usb-audio: Refactor usb_audio_make_longname() to use seq_buf Bill Wendling
2026-09-17  7:38   ` sashiko-bot
2026-09-15  8:18 ` [PATCH 06/28] comedi: comedi_bond: Refactor strlcat() to seq_buf in do_dev_config() Bill Wendling
2026-09-15  8:18 ` [PATCH 07/28] scsi: bfa: Use snprintf() in bfa_fcs_fabric_psymb_init() Bill Wendling
2026-09-15  8:18 ` [PATCH 08/28] devlink: Refactor strlcat() to seq_buf in __devlink_compat_running_version() Bill Wendling
2026-09-17  7:38   ` sashiko-bot
2026-09-15  8:18 ` [PATCH 09/28] drm/dp_mst: Refactor build_mst_prop_path() to use seq_buf Bill Wendling
2026-09-15  8:18 ` [PATCH 10/28] of/fdt: Replace strlcat() with snprintf() in early_init_dt_scan_chosen() Bill Wendling
2026-09-15 15:05   ` Rob Herring
2026-09-15  8:18 ` [PATCH 11/28] wifi: brcmfmac: Replace strlcat() with snprintf() in brcmf_fw_alloc_request() Bill Wendling
2026-09-15  8:18 ` [PATCH 12/28] fortify: Convert strlcat() to snprintf() in strcat() Bill Wendling
2026-09-17  7:38   ` sashiko-bot
2026-09-15  8:18 ` [PATCH 13/28] i40e: Replace strlcat() with snprintf() in i40e_nvm_version_str() Bill Wendling
2026-09-15  8:18 ` [PATCH 14/28] ALSA: usb-audio: Refactor append_ctl_name() to use snprintf() Bill Wendling
2026-09-15  8:18 ` [PATCH 15/28] orangefs: Use seq_buf for debug help string generation Bill Wendling
2026-09-22 16:11   ` Mike Marshall
2026-09-15  8:18 ` [PATCH 16/28] pinctrl: samsung: Use snprintf() to construct pin bank names Bill Wendling
2026-09-16  6:01   ` Loktionov, Aleksandr
2026-09-15  8:18 ` [PATCH 17/28] MIPS: cmdline: Refactor bootcmdline_append() to use snprintf() Bill Wendling
2026-09-15  8:18 ` [PATCH 18/28] LoongArch: Refactor bootcmdline_init() to use seq_buf instead of strlcat() Bill Wendling
2026-09-15  8:18 ` [PATCH 19/28] x86/setup: Use snprintf() to concatenate builtin and boot command lines Bill Wendling
2026-09-17  7:38   ` sashiko-bot
2026-09-15  8:18 ` [PATCH 20/28] parisc: Refactor strlcat() to seq_buf in setup_cmdline() Bill Wendling
2026-09-15  8:18 ` [PATCH 21/28] NFS: nfsroot: Refactor root_nfs_cat() to use snprintf() Bill Wendling
2026-09-15 18:52   ` Kees Cook
2026-09-15 19:30     ` Bill Wendling
2026-09-15  8:18 ` [PATCH 22/28] media: si2165: Use snprintf() to format frontend name Bill Wendling
2026-09-16  6:02   ` Loktionov, Aleksandr
2026-09-15  8:18 ` [PATCH 23/28] Input: synaptics_usb - use seq_buf and snprintf() for name and phys Bill Wendling
2026-09-15  8:18 ` [PATCH 24/28] EDAC/thunderx: Fix stale error context in thunderx_l2c_threaded_isr() Bill Wendling
2026-09-16  6:02   ` Loktionov, Aleksandr
2026-09-15  8:18 ` [PATCH 25/28] EDAC/thunderx: Replace strlcat() with seq_buf Bill Wendling
2026-09-15 20:00   ` Kees Cook
2026-09-16  1:09     ` Borislav Petkov
2026-09-16 21:43       ` Bill Wendling
2026-09-15  8:18 ` [PATCH 26/28] wifi: wil6210: Refactor resume_triggers2string() to use seq_buf Bill Wendling
2026-09-15  8:18 ` [PATCH 27/28] drm/xe/pf: Convert strlcat() to seq_buf in control_read() Bill Wendling
2026-09-15 18:25   ` Kees Cook
2026-09-15  8:18 ` [PATCH 28/28] drm/xe/pf: Refactor strlcat() to seq_buf in sched_group_engines_read() Bill Wendling
2026-09-15 18:30   ` Kees Cook
2026-09-15 11:24 ` [PATCH 00/28] Replace remaining strlcat() call sites with snprintf()/seq_buf() Takashi Iwai
2026-09-15 14:23 ` ✓ CI.KUnit: success for " Patchwork
2026-09-15 18:05 ` Kees Cook [this message]

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=202609151055.AFC6267@keescook \
    --to=kees@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=abbotti@mev.co.uk \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anil.gurumurthy@qlogic.com \
    --cc=anna@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ardb@kernel.org \
    --cc=arend.vanspriel@broadcom.com \
    --cc=arunr@valvesoftware.com \
    --cc=ashutoshdesai993@gmail.com \
    --cc=blum@kernel.org \
    --cc=bp@alien8.de \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=cassiogabrielcontato@gmail.com \
    --cc=cel@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=cryolitia@uniontech.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=devel@lists.orangefs.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=horms@kernel.org \
    --cc=hpa@zytor.com \
    --cc=hsweeten@visionengravers.com \
    --cc=hubcap@omnibond.com \
    --cc=i@rong.moe \
    --cc=imre.deak@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jiri@resnulli.us \
    --cc=jlayton@kernel.org \
    --cc=johan@kernel.org \
    --cc=johannes.berg@intel.com \
    --cc=kernel@xen0n.name \
    --cc=krzk@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=loongarch@lists.linux.dev \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maqianga@uniontech.com \
    --cc=martin@omnibond.com \
    --cc=matthew.brost@intel.com \
    --cc=mchehab@kernel.org \
    --cc=mingo@redhat.com \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=mkp@kernel.org \
    --cc=morbo@google.com \
    --cc=mripard@kernel.org \
    --cc=mrwillporter@gmail.com \
    --cc=neil@brown.name \
    --cc=netdev@vger.kernel.org \
    --cc=nikitash.mariiaw@gmail.com \
    --cc=okorniev@redhat.com \
    --cc=pabeni@redhat.com \
    --cc=pengpeng@iscas.ac.cn \
    --cc=perex@perex.cz \
    --cc=peter.griffin@linaro.org \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=r772577952@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=rppt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=saravanak@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=sudarsana.kalluru@qlogic.com \
    --cc=tglx@kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=tom@talpey.com \
    --cc=tony.luck@intel.com \
    --cc=trondmy@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=tzimmermann@suse.de \
    --cc=wangkanglong@loongson.cn \
    --cc=x86@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    --cc=zzam@gentoo.org \
    --cc=zzzccc427@gmail.com \
    /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.