Replace remaining strlcat() call sites with snprintf()/seq_buf()
Subsystems (34)
cover Replace remaining strlcat() call sites with snprintf()/seq_buf()
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.
One unrelated fix is included. While auditing drivers/edac/thunderx_edac.c for its strlcat() conversion, "EDAC/thunderx: Fix stale error context in thunderx_l2c_threaded_isr()" addresses a pre-existing bug, present since the driver's original 2017 commit: thunderx_l2c_threaded_isr() computes its ring "tail"/"ctx" once before its drain loop and never recomputes them per iteration, unlike the analogous OCX handlers in the same file, so it re-reports the same ring entry for every queued error instead of draining the ring. It's split out as its own patch, ahead of the strlcat() conversion for that file, so it can be reviewed and backported independently of the rest of this series.
Bill Wendling (28):
ALSA: ac97: Refactor snd_ac97_get_name() to use snprintf()
sunrpc: Refactor rpc_sockaddr2uaddr() to use snprintf() instead of
strlcat()
ARM: atags: Replace strlcat() with snprintf() for cmdline extend
scsi: bfa: Use snprintf() in bfa_fcs_fabric_nsymb_init()
ALSA: usb-audio: Refactor usb_audio_make_longname() to use seq_buf
comedi: comedi_bond: Refactor strlcat() to seq_buf in do_dev_config()
scsi: bfa: Use snprintf() in bfa_fcs_fabric_psymb_init()
devlink: Refactor strlcat() to seq_buf in
__devlink_compat_running_version()
drm/dp_mst: Refactor build_mst_prop_path() to use seq_buf of/fdt: Replace strlcat() with snprintf() in
early_init_dt_scan_chosen()
wifi: brcmfmac: Replace strlcat() with snprintf() in
brcmf_fw_alloc_request()
fortify: Convert strlcat() to snprintf() in strcat()
i40e: Replace strlcat() with snprintf() in i40e_nvm_version_str()
ALSA: usb-audio: Refactor append_ctl_name() to use snprintf()
orangefs: Use seq_buf for debug help string generation
pinctrl: samsung: Use snprintf() to construct pin bank names
MIPS: cmdline: Refactor bootcmdline_append() to use snprintf()
LoongArch: Refactor bootcmdline_init() to use seq_buf instead of
strlcat()
x86/setup: Use snprintf() to concatenate builtin and boot command
lines
parisc: Refactor strlcat() to seq_buf in setup_cmdline()
NFS: nfsroot: Refactor root_nfs_cat() to use snprintf()
media: si2165: Use snprintf() to format frontend name
Input: synaptics_usb - use seq_buf and snprintf() for name and phys EDAC/thunderx: Fix stale error context in thunderx_l2c_threaded_isr() EDAC/thunderx: Replace strlcat() with seq_buf
wifi: wil6210: Refactor resume_triggers2string() to use seq_buf drm/xe/pf: Convert strlcat() to seq_buf in control_read() drm/xe/pf: Refactor strlcat() to seq_buf in sched_group_engines_read()
arch/arm/kernel/atags_parse.c | 7 +- arch/loongarch/kernel/setup.c | 22 +++-- arch/mips/kernel/setup.c | 21 ++++- arch/parisc/kernel/setup.c | 16 ++-- arch/x86/kernel/setup.c | 8 +- drivers/comedi/drivers/comedi_bond.c | 16 ++-- drivers/edac/thunderx_edac.c | 67 ++++++++++------ drivers/gpu/drm/display/drm_dp_mst_topology.c | 15 ++-- drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c | 24 +++--- drivers/input/mouse/synaptics_usb.c | 29 ++++--- drivers/media/dvb-frontends/si2165.c | 17 ++-- drivers/net/ethernet/intel/i40e/i40e.h | 15 +++- drivers/net/wireless/ath/wil6210/wmi.c | 38 +++++---- .../broadcom/brcm80211/brcmfmac/firmware.c | 21 ++--- drivers/of/fdt.c | 11 ++- drivers/pinctrl/samsung/pinctrl-samsung.c | 3 +- drivers/scsi/bfa/bfa_fcs.c | 80 +++++-------------- fs/nfs/nfsroot.c | 11 ++- fs/orangefs/orangefs-debugfs.c | 36 ++++----- include/linux/fortify-string.h | 7 +- net/devlink/dev.c | 8 +- net/sunrpc/addr.c | 16 ++-- sound/pci/ac97/ac97_codec.c | 9 ++- sound/usb/card.c | 58 +++++++++----- sound/usb/mixer.c | 8 +- 25 files changed, 309 insertions(+), 254 deletions(-)
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signature · 1 line
2.47.3
PATCH 1/28 ALSA: ac97: Refactor snd_ac97_get_name() to use snprintf()
snd_ac97_get_name() appends the codec name using two strlcat() calls and then appends the revision using an unbounded sprintf() at "name + strlen(name)", which could overflow the destination buffer.
In preparation for removing the deprecated strlcat() API[1], replace the strlcat() and sprintf() calls with a single snprintf() using the existing string length, matching the pattern already used in the "else" branch.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- sound/pci/ac97/ac97_codec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
sound/pci/ac97/ac97_codec.c +6 -3
@@ -1850,10 +1850,12 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, pid =look_for_codec_id (snd_ac97_codec_ids, id);if (pid) { -strlcat (name," " , maxlen); -strlcat (name, pid->name, maxlen); +int l =strlen (name); +if (pid->mask !=0xffffffff ) -sprintf (name +strlen (name)," rev %u" , id & ~pid->mask); +snprintf (name + l, maxlen - l," %s rev %u" , pid->name, id & ~pid->mask); +else +snprintf (name + l, maxlen - l," %s" , pid->name);if (ac97 && pid->patch) {if ((modem && (pid->flags &AC97_MODEM_PATCH )) || (! modem && ! (pid->flags &AC97_MODEM_PATCH )))
@@ -1861,6 +1863,7 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, } }else {int l =strlen (name); +snprintf (name + l, maxlen - l," id %x" , id &0xff ); } }
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Kees Cook
maintainerRe: [PATCH 01/28] ALSA: ac97: Refactor snd_ac97_get_name() to use snprintf()
Quoted 19 lines · Bill Wendling
sound/pci/ac97/ac97_codec.c +5
-3@@ -1850,10 +1850,12 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, pid =look_for_codec_id (snd_ac97_codec_ids, id);if (pid) { -strlcat (name," " , maxlen); -strlcat (name, pid->name, maxlen); +int l =strlen (name); +if (pid->mask !=0xffffffff ) -sprintf (name +strlen (name)," rev %u" , id & ~pid->mask); +snprintf (name + l, maxlen - l," %s rev %u" , pid->name, id & ~pid->mask); +else +snprintf (name + l, maxlen - l," %s" , pid->name);if (ac97 && pid->patch) {if ((modem && (pid->flags &AC97_MODEM_PATCH )) || (! modem && ! (pid->flags &AC97_MODEM_PATCH )))
sound/pci/ac97/ac97_codec.c void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, · line 1869
Quoted 7 lines
sound/pci/ac97/ac97_codec.c +1
-0@@ -1861,6 +1863,7 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, } }else {int l =strlen (name); +snprintf (name + l, maxlen - l," id %x" , id &0xff ); } }
I'd rather not open-code the length math here. Can't we use seq_buf() instead?
Signature · 1 line
Kees Cook
Re: [PATCH 01/28] ALSA: ac97: Refactor snd_ac97_get_name() to use snprintf()
On Tue, 15 Sep 2026 11:39:34 -0700
Kees Cook <[email protected]> wrote:
(I've just juked a lot of the 'reply to' list - too long to gmail.)
Quoted 22 lines · Bill Wendling
Quoted 21 lines
sound/pci/ac97/ac97_codec.c +5
-3@@ -1850,10 +1850,12 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, pid =look_for_codec_id (snd_ac97_codec_ids, id);if (pid) { -strlcat (name," " , maxlen); -strlcat (name, pid->name, maxlen); +int l =strlen (name); +if (pid->mask !=0xffffffff ) -sprintf (name +strlen (name)," rev %u" , id & ~pid->mask); +snprintf (name + l, maxlen - l," %s rev %u" , pid->name, id & ~pid->mask); +else +snprintf (name + l, maxlen - l," %s" , pid->name);if (ac97 && pid->patch) {if ((modem && (pid->flags &AC97_MODEM_PATCH )) || (! modem && ! (pid->flags &AC97_MODEM_PATCH )))@@ -1861,6 +1863,7 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, } }else {
Quoted 9 lines
sound/pci/ac97/ac97_codec.c void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, · line 1869
Quoted 5 lines
sound/pci/ac97/ac97_codec.c +1
-0int l =strlen (name); +snprintf (name + l, maxlen - l," id %x" , id &0xff ); } }I'd rather not open-code the length math here. Can't we use
seq_buf()instead?
Or just use the length returned by the strscpy() call that wrote the initial part of name[].
The return the name length so the callers don't have to use strcat() themselves.
Replacing strlcat() with strlen() and a copy is just pointless.
David
PATCH 2/28 sunrpc: Refactor rpc_sockaddr2uaddr() to use snprintf() instead of strlcat()
In reply to Bill Wendlingrpc_sockaddr2uaddr() formats the IP address into "addrbuf", formats the port into a temporary "portbuf" buffer with snprintf(), and then appends "portbuf" to "addrbuf" using strlcat().
In preparation for removing the deprecated strlcat() API[1], capture the length returned by rpc_ntop4() and rpc_ntop6_noscopeid() and format the port directly onto the end of "addrbuf" with snprintf(). This eliminates the strlcat() call and the temporary "portbuf" buffer.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- net/sunrpc/addr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
net/sunrpc/addr.c +8 -8
@@ -264,18 +264,20 @@ EXPORT_SYMBOL_GPL(rpc_pton);*/ char *rpc_sockaddr2uaddr (const struct sockaddr *sap,gfp_t gfp_flags) { -char portbuf[RPCBIND_MAXUADDRPLEN ];char addrbuf[RPCBIND_MAXUADDRLEN ];unsigned short port; +size_t len;switch (sap->sa_family) {case AF_INET : -if (rpc_ntop4 (sap, addrbuf,sizeof (addrbuf)) ==0 ) + len =rpc_ntop4 (sap, addrbuf,sizeof (addrbuf)); +if (len ==0 || len >=sizeof (addrbuf))return NULL ; port =ntohs (((struct sockaddr_in *)sap)->sin_port);break ;case AF_INET6 : -if (rpc_ntop6_noscopeid (sap, addrbuf,sizeof (addrbuf)) ==0 ) + len =rpc_ntop6_noscopeid (sap, addrbuf,sizeof (addrbuf)); +if (len ==0 || len >=sizeof (addrbuf))return NULL ; port =ntohs (((struct sockaddr_in6 *)sap)->sin6_port);break ;
@@ -283,11 +285,8 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags)return NULL ; } -if (snprintf (portbuf,sizeof (portbuf), -".%u.%u" , port >>8 , port &0xff ) >= (int )sizeof (portbuf)) -return NULL ; - -if (strlcat (addrbuf, portbuf,sizeof (addrbuf)) >=sizeof (addrbuf)) +if (snprintf (addrbuf + len,sizeof (addrbuf) - len, +".%u.%u" , port >>8 , port &0xff ) >=sizeof (addrbuf) - len)return NULL ;return kstrdup (addrbuf, gfp_flags);
@@ -352,3 +351,4 @@ size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr,return 0 ; }EXPORT_SYMBOL_GPL (rpc_uaddr2sockaddr); +
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Re: [PATCH 02/28] sunrpc: Refactor rpc_sockaddr2uaddr() to use snprintf() instead of strlcat()
Quoted 171 lines · Bill Wendling
rpc_sockaddr2uaddr()formats the IP address into "addrbuf", formats the port into a temporary "portbuf" buffer withsnprintf(), and then appends "portbuf" to "addrbuf" usingstrlcat().In preparation for removing the deprecated
strlcat()API[1], capture the length returned byrpc_ntop4()andrpc_ntop6_noscopeid()and format the port directly onto the end of "addrbuf" withsnprintf(). This eliminates thestrlcat()call and the temporary "portbuf" buffer.Assisted-by CoPilot:3.5-sonnet [editor_update_file, shell_command_run]Signed-off-by Bill Wendling <[email protected]>---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- net/sunrpc/addr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)net/sunrpc/addr.c +7
-8@@ -264,18 +264,20 @@ EXPORT_SYMBOL_GPL(rpc_pton);*/ char *rpc_sockaddr2uaddr (const struct sockaddr *sap,gfp_t gfp_flags) { -char portbuf[RPCBIND_MAXUADDRPLEN ];char addrbuf[RPCBIND_MAXUADDRLEN ];unsigned short port; +size_t len;switch (sap->sa_family) {case AF_INET : -if (rpc_ntop4 (sap, addrbuf,sizeof (addrbuf)) ==0 ) + len =rpc_ntop4 (sap, addrbuf,sizeof (addrbuf)); +if (len ==0 || len >=sizeof (addrbuf))return NULL ; port =ntohs (((struct sockaddr_in *)sap)->sin_port);break ;case AF_INET6 : -if (rpc_ntop6_noscopeid (sap, addrbuf,sizeof (addrbuf)) ==0 ) + len =rpc_ntop6_noscopeid (sap, addrbuf,sizeof (addrbuf)); +if (len ==0 || len >=sizeof (addrbuf))return NULL ; port =ntohs (((struct sockaddr_in6 *)sap)->sin6_port);break ;@@ -283,11 +285,8 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags)return NULL ; } -if (snprintf (portbuf,sizeof (portbuf), -".%u.%u" , port >>8 , port &0xff ) >= (int )sizeof (portbuf)) -return NULL ; - -if (strlcat (addrbuf, portbuf,sizeof (addrbuf)) >=sizeof (addrbuf)) +if (snprintf (addrbuf + len,sizeof (addrbuf) - len, +".%u.%u" , port >>8 , port &0xff ) >=sizeof (addrbuf) - len)return NULL ;return kstrdup (addrbuf, gfp_flags);
net/sunrpc/addr.c size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr, · line 354
Quoted 4 lines
net/sunrpc/addr.c +1
-0@@ -352,3 +351,4 @@ size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr,return 0 ; }EXPORT_SYMBOL_GPL (rpc_uaddr2sockaddr); +
The last blank line here is not needed. The rest looks fine though.
PATCH 3/28 ARM: atags: Replace strlcat() with snprintf() for cmdline extend
In reply to Bill WendlingWhen CONFIG_CMDLINE_EXTEND is enabled, parse_tag_cmdline() uses two strlcat() calls to append a space and the bootloader tag command line to default_command_line.
In preparation for removing the deprecated strlcat() API[1], compute the length of default_command_line once and append the space and tag command line in a single snprintf() call.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- arch/arm/kernel/atags_parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/kernel/atags_parse.c +4 -3
@@ -121,9 +121,10 @@ __tagtable(ATAG_REVISION, parse_tag_revision);static int __init parse_tag_cmdline (const struct tag *tag) {#if defined(CONFIG_CMDLINE_EXTEND ) -strlcat (default_command_line," " ,COMMAND_LINE_SIZE ); -strlcat (default_command_line, tag->u.cmdline.cmdline, -COMMAND_LINE_SIZE ); +size_t len =strlen (default_command_line); + +snprintf (default_command_line + len,COMMAND_LINE_SIZE - len, +" %s" , tag->u.cmdline.cmdline);#elif defined(CONFIG_CMDLINE_FORCE )pr_warn ("Ignoring tag cmdline (using the default kernel command line)\n" );#else
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Kees Cook
maintainerRe: [PATCH 03/28] ARM: atags: Replace strlcat() with snprintf() for cmdline extend
Quoted 6 lines · Bill Wendling
arch/arm/kernel/atags_parse.c +0
-0@@ -121,9 +121,10 @@ __tagtable(ATAG_REVISION, parse_tag_revision);static int __init parse_tag_cmdline (const struct tag *tag) {#if defined(CONFIG_CMDLINE_EXTEND )
arch/arm/kernel/atags_parse.c __tagtable(ATAG_REVISION, parse_tag_revision); · line 130
Quoted 10 lines
arch/arm/kernel/atags_parse.c +4
-3-strlcat (default_command_line," " ,COMMAND_LINE_SIZE ); -strlcat (default_command_line, tag->u.cmdline.cmdline, -COMMAND_LINE_SIZE ); +size_t len =strlen (default_command_line); + +snprintf (default_command_line + len,COMMAND_LINE_SIZE - len, +" %s" , tag->u.cmdline.cmdline);#elif defined(CONFIG_CMDLINE_FORCE )pr_warn ("Ignoring tag cmdline (using the default kernel command line)\n" );#else
It's pretty clear we have a pattern of "simple append" that is needed, and while strlcat() does that, it's horrible. I feel like we need an appending scnprintf(), and it needs to return like strscpy() does (i.e. -E2BIG on truncation).
My goal would be:
- don't open-code string length math
- never leave the destination unterminated
- allow for format strings
- yes/no return indication for "did this truncate?"
Initializing a whole seq_buf struct for these small cases is too much overhead...
For both cases (small without seq_buf, large with seq_buf), it is also frequently needed to know the resulting strlen. seq_buf doesn't do this right today, and a strscpy-style return value also doesn't tell us. :(
Signature · 1 line
Kees Cook
Re: [PATCH 03/28] ARM: atags: Replace strlcat() with snprintf() for cmdline extend
Quoted 30 lines · Kees Cook
Quoted 6 lines · Bill Wendling
arch/arm/kernel/atags_parse.c +0
-0@@ -121,9 +121,10 @@ __tagtable(ATAG_REVISION, parse_tag_revision);static int __init parse_tag_cmdline (const struct tag *tag) {#if defined(CONFIG_CMDLINE_EXTEND )arch/arm/kernel/atags_parse.c __tagtable(ATAG_REVISION, parse_tag_revision); · line 130
Quoted 10 lines
arch/arm/kernel/atags_parse.c +4
-3-strlcat (default_command_line," " ,COMMAND_LINE_SIZE ); -strlcat (default_command_line, tag->u.cmdline.cmdline, -COMMAND_LINE_SIZE ); +size_t len =strlen (default_command_line); + +snprintf (default_command_line + len,COMMAND_LINE_SIZE - len, +" %s" , tag->u.cmdline.cmdline);#elif defined(CONFIG_CMDLINE_FORCE )pr_warn ("Ignoring tag cmdline (using the default kernel command line)\n" );#else It's pretty clear we have a pattern of "simple append" that is needed, and while
strlcat()does that, it's horrible. I feel like we need an appendingscnprintf(), and it needs to return likestrscpy()does (i.e.-E2BIGon truncation).My goal would be:
- don't open-code string length math
- never leave the destination unterminated
- allow for format strings
- yes/no return indication for "did this truncate?"
Quoted 7 lines
Initializing a whole
seq_bufstruct for these small cases is too much overhead...For both cases (small without
seq_buf, large withseq_buf), it is also frequently needed to know the resulting strlen.seq_bufdoesn't do this right today, and a strscpy-style return value also doesn't tell us. :(
Something like "llvm::Twine" would work well for this.
-bw
[email protected]
AI reviewRe: [PATCH 03/28] ARM: atags: Replace strlcat() with snprintf() for cmdline extend
In reply to Bill WendlingThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] arm: atags: OOB read and panic in parse_tag_cmdline() due to strlen() --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] arm: atags: OOB read and panic in parse_tag_cmdline() due to strlen() --
commit 9d3172b712a6dbf6594b26ae8fb56ebd952c7d66
Author: Bill Wendling <[email protected]>
ARM: atags: Replace strlcat() with snprintf() for cmdline extend
This commit replaces the deprecated strlcat() API with snprintf() in parse_tag_cmdline() to append the bootloader tag command line to default_command_line.
arch/arm/kernel/atags_parse.c __tagtable(ATAG_REVISION, parse_tag_revision); · line 124
Quoted 12 lines
arch/arm/kernel/atags_parse.c +1
-3@@ -121,9 +121,10 @@ __tagtable(ATAG_REVISION, parse_tag_revision);static int __init parse_tag_cmdline (const struct tag *tag) {#if defined(CONFIG_CMDLINE_EXTEND ) -strlcat (default_command_line," " ,COMMAND_LINE_SIZE ); -strlcat (default_command_line, tag->u.cmdline.cmdline, -COMMAND_LINE_SIZE ); +size_t len =strlen (default_command_line);
[Severity: High]
Is it possible for strlen() to read out of bounds or panic here?
If CONFIG_CMDLINE is exactly COMMAND_LINE_SIZE characters long, the C compiler initializes the default_command_line array without a null terminator. The original strlcat() code used strnlen() underneath and handled full buffers safely.
Under CONFIG_FORTIFY_SOURCE, calling strlen() on an unterminated buffer triggers a fortify_panic(), which will crash the kernel during early boot.
Without CONFIG_FORTIFY_SOURCE, strlen() will read out of bounds until it finds a null byte, resulting in len being larger than COMMAND_LINE_SIZE.
arch/arm/kernel/atags_parse.c __tagtable(ATAG_REVISION, parse_tag_revision); · line 127
Quoted 3 lines
arch/arm/kernel/atags_parse.c +3
-0+ +snprintf (default_command_line + len,COMMAND_LINE_SIZE - len, +" %s" , tag->u.cmdline.cmdline);
[Severity: High]
If len exceeds COMMAND_LINE_SIZE as described above, will this calculation underflow?
This would cause COMMAND_LINE_SIZE - len to mathematically underflow to a huge unsigned value.
When this huge size parameter is passed to snprintf(), it triggers a WARN_ON_ONCE(size > INT_MAX) in vsnprintf().
Quoted 2 lines
arch/arm/kernel/atags_parse.c +0
-0#elif defined(CONFIG_CMDLINE_FORCE )pr_warn ("Ignoring tag cmdline (using the default kernel command line)\n" );
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH 4/28 scsi: bfa: Use snprintf() in bfa_fcs_fabric_nsymb_init()
In reply to Bill Wendlingbfa_fcs_fabric_nsymb_init() constructs the node symbolic name using strscpy() followed by five strlcat() calls and explicit NUL-termination.
In preparation for removing the deprecated strlcat() API[1], replace the chained string copies with a single snprintf() call.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/scsi/bfa/bfa_fcs.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-)
drivers/scsi/bfa/bfa_fcs.c +7 -24
@@ -821,30 +821,13 @@ bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric)bfa_ioc_get_adapter_model (&fabric->fcs->bfa->ioc, model); -/* Model name/number */ -strscpy (port_cfg->node_sym_name.symname, model, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->node_sym_name.symname, -BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); - -/* Driver Version */ -strlcat (port_cfg->node_sym_name.symname, (char *)driver_info->version, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->node_sym_name.symname, -BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); - -/* Host machine name */ -strlcat (port_cfg->node_sym_name.symname, - driver_info->host_machine_name, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->node_sym_name.symname, -BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); - -/* null terminate */ - port_cfg->node_sym_name.symname[BFA_SYMNAME_MAXLEN -1 ] =0 ; +/* Model name/number, Driver Version, Host machine name */ +snprintf (port_cfg->node_sym_name.symname,BFA_SYMNAME_MAXLEN , +"%s" BFA_FCS_PORT_SYMBNAME_SEPARATOR +"%s" BFA_FCS_PORT_SYMBNAME_SEPARATOR +"%s" BFA_FCS_PORT_SYMBNAME_SEPARATOR , + model, (char *)driver_info->version, + driver_info->host_machine_name); }/*
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
[email protected]
AI reviewRe: [PATCH 04/28] scsi: bfa: Use snprintf() in bfa_fcs_fabric_nsymb_init()
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] scsi: bfa: missing char* cast for host_machine_name causes -Wformat warning --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] scsi: bfa: missing char* cast for host_machine_name causes -Wformat warning --
commit e9ab2501ca8e083742e7d8a4f33a0d89bbb70aad
Author: Bill Wendling <[email protected]>
scsi: bfa: Use snprintf() in bfa_fcs_fabric_nsymb_init()
This commit replaces chained strscpy() and strlcat() calls with a single snprintf() call when constructing the node symbolic name.
Quoted 4 lines
drivers/scsi/bfa/bfa_fcs.c +0
-0
[ ... ]
Quoted 1 line
drivers/scsi/bfa/bfa_fcs.c +0
-0@@ -821,30 +821,13 @@ bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric)
[ ... ]
drivers/scsi/bfa/bfa_fcs.c bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric) · line 830
Quoted 9 lines
drivers/scsi/bfa/bfa_fcs.c +7
-2-/* null terminate */ - port_cfg->node_sym_name.symname[BFA_SYMNAME_MAXLEN -1 ] =0 ; +/* Model name/number, Driver Version, Host machine name */ +snprintf (port_cfg->node_sym_name.symname,BFA_SYMNAME_MAXLEN , +"%s" BFA_FCS_PORT_SYMBNAME_SEPARATOR +"%s" BFA_FCS_PORT_SYMBNAME_SEPARATOR +"%s" BFA_FCS_PORT_SYMBNAME_SEPARATOR , + model, (char *)driver_info->version, + driver_info->host_machine_name);
[Severity: Low]
Does this missing cast create a -Wformat compiler warning?
Looking at bfa_fcs_fabric_nsymb_init(), host_machine_name is passed to the %s format specifier without an explicit (char *) cast, while version on the preceding line includes one.
Does this cause a type mismatch warning since host_machine_name is an unsigned char array?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
PATCH 5/28 ALSA: usb-audio: Refactor usb_audio_make_longname() to use seq_buf
In reply to Bill Wendlingusb_audio_make_longname() builds card->longname incrementally from the vendor/manufacturer name, shortname, USB device path, and USB speed using strscpy(), strlcat(), and manual buffer offset calculations for usb_make_path().
In preparation for removing the deprecated strlcat() API[1], refactor usb_audio_make_longname() to use struct seq_buf to track the buffer position and remaining space across these operations.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- sound/usb/card.c | 58 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 19 deletions(-)
sound/usb/card.c +39 -19
@@ -25,6 +25,7 @@#include <linux/list.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/seq_buf.h> #include <linux/ctype.h> #include <linux/usb.h> #include <linux/moduleparam.h>
@@ -651,7 +652,9 @@ static void usb_audio_make_longname(struct usb_device *dev,struct snd_card *card = chip->card;const struct usb_audio_device_name *preset;const char *s =NULL ; -int len; +struct seq_buf sb; +char *buf; +size_t size; preset =lookup_device_name (chip->usb_id);
@@ -667,44 +670,61 @@ static void usb_audio_make_longname(struct usb_device *dev, s = preset->vendor_name; else if (quirk && quirk->vendor_name) s = quirk->vendor_name; - *card->longname =0 ; -if (s && *s) -strscpy (card->longname, s); -else if (dev->manufacturer && *dev->manufacturer) -strscpy (card->longname, dev->manufacturer); -if (*card->longname) { -strim (card->longname); -if (*card->longname) -strlcat (card->longname," " ,sizeof (card->longname)); +seq_buf_init (&sb, card->longname,sizeof (card->longname)); + +if (s && *s) +seq_buf_puts (&sb, s); +else if (dev->manufacturer && *dev->manufacturer) +seq_buf_puts (&sb, dev->manufacturer); + +if (seq_buf_used (&sb)) { +char *trimmed; + +seq_buf_str (&sb); + trimmed =strim (card->longname); +if (trimmed != card->longname) +memmove (card->longname, trimmed,strlen (trimmed) +1 ); + sb.len =strlen (card->longname); +if (sb.len) +seq_buf_putc (&sb,' ' ); } -strlcat (card->longname, card->shortname,sizeof (card->longname)); +seq_buf_puts (&sb, card->shortname); - len =strlcat (card->longname," at " ,sizeof (card->longname)); +seq_buf_puts (&sb," at " ); -if (len <sizeof (card->longname)) -usb_make_path (dev, card->longname + len,sizeof (card->longname) - len); + size =seq_buf_get_buf (&sb, &buf); +if (size >0 ) { +int path_len =usb_make_path (dev, buf, size); + +if (path_len >=0 ) +seq_buf_commit (&sb, path_len); +else +seq_buf_set_overflow (&sb); + }switch (snd_usb_get_speed (dev)) {case USB_SPEED_LOW : -strlcat (card->longname,", low speed" ,sizeof (card->longname)); +seq_buf_puts (&sb,", low speed" );break ;case USB_SPEED_FULL : -strlcat (card->longname,", full speed" ,sizeof (card->longname)); +seq_buf_puts (&sb,", full speed" );break ;case USB_SPEED_HIGH : -strlcat (card->longname,", high speed" ,sizeof (card->longname)); +seq_buf_puts (&sb,", high speed" );break ;case USB_SPEED_SUPER : -strlcat (card->longname,", super speed" ,sizeof (card->longname)); +seq_buf_puts (&sb,", super speed" );break ;case USB_SPEED_SUPER_PLUS : -strlcat (card->longname,", super speed plus" ,sizeof (card->longname)); +seq_buf_puts (&sb,", super speed plus" );break ;default :break ; } + +seq_buf_str (&sb); }static void snd_usb_init_quirk_flags (int idx,struct snd_usb_audio *chip)
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
[email protected]
AI reviewRe: [PATCH 05/28] ALSA: usb-audio: Refactor usb_audio_make_longname() to use seq_buf
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] alsa: usb-audio: string corruption in usb_audio_make_longname() on seq_buf overflow --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] alsa: usb-audio: string corruption in usb_audio_make_longname() on seq_buf overflow --
commit 4261f1e1f38e25d5a907e1a1ad3aeefb3e4075ae
Author: Bill Wendling <[email protected]>
ALSA: usb-audio: Refactor usb_audio_make_longname() to use seq_buf
This commit refactors usb_audio_make_longname() to use struct seq_buf instead of deprecated string functions like strlcat() for building the device longname.
Quoted 4 lines
sound/usb/card.c +0
-0
[ ... ]
Quoted 20 lines
sound/usb/card.c +6
-8@@ -667,44 +670,61 @@ static void usb_audio_make_longname(struct usb_device *dev, s = preset->vendor_name; else if (quirk && quirk->vendor_name) s = quirk->vendor_name; - *card->longname =0 ; + +seq_buf_init (&sb, card->longname,sizeof (card->longname)); +if (s && *s) -strscpy (card->longname, s); +seq_buf_puts (&sb, s);else if (dev->manufacturer && *dev->manufacturer) -strscpy (card->longname, dev->manufacturer); - -if (*card->longname) { -strim (card->longname); -if (*card->longname) -strlcat (card->longname," " ,sizeof (card->longname)); +seq_buf_puts (&sb, dev->manufacturer); +
sound/usb/card.c static void usb_audio_make_longname(struct usb_device *dev, · line 690
Quoted 10 lines
sound/usb/card.c +10
-0+if (seq_buf_used (&sb)) { +char *trimmed; + +seq_buf_str (&sb); + trimmed =strim (card->longname); +if (trimmed != card->longname) +memmove (card->longname, trimmed,strlen (trimmed) +1 ); + sb.len =strlen (card->longname); +if (sb.len) +seq_buf_putc (&sb,' ' );
[Severity: Medium]
Does this seq_buf_putc() call leave the string without a null terminator if the buffer subsequently overflows?
strim() and memmove() remove leading and trailing spaces by shifting the string and inserting a null terminator, but they leave the old shifted characters in the buffer immediately after the new null terminator. seq_buf_putc() then overwrites the new null terminator with a space, but does not append a new one to maintain string safety.
If any subsequent seq_buf_puts() calls (like shortname, path, or speed) exceed the 80-byte capacity, they silently abort and place the buffer into an overflow state without writing a new null terminator.
At the end of usb_audio_make_longname(), seq_buf_str() sees the overflow state and places a null terminator only at the very end of the buffer, not at the logical string end.
Can this expose duplicated characters or trailing spaces when the device manufacturer string and subsequent concatenated parts exceed 80 bytes?
Quoted 6 lines
sound/usb/card.c +1
-2} -strlcat (card->longname, card->shortname,sizeof (card->longname)); +seq_buf_puts (&sb, card->shortname); - len =strlcat (card->longname," at " ,sizeof (card->longname));
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
PATCH 6/28 comedi: comedi_bond: Refactor strlcat() to seq_buf in do_dev_config()
In reply to Bill Wendlingdo_dev_config() builds a space-separated list of bonded devices in devpriv->name by formatting each "minor:subdev " pair into a temporary stack buffer with snprintf() and appending it with strlcat() in a loop.
In preparation for removing the deprecated strlcat() API[1], use struct seq_buf and seq_buf_printf() to format each entry directly into devpriv->name. This avoids repeated rescanning of devpriv->name and eliminates the temporary buffer.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/comedi/drivers/comedi_bond.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/comedi/drivers/comedi_bond.c +7 -9
@@ -39,6 +39,7 @@#include <linux/module.h> #include <linux/string.h> +#include <linux/seq_buf.h> #include <linux/slab.h> #include <linux/comedi.h> #include <linux/comedi/comedilib.h>
@@ -170,10 +171,11 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) {struct comedi_bond_private *devpriv = dev->private;DECLARE_BITMAP (devs_opened,COMEDI_NUM_BOARD_MINORS ); +struct seq_buf s;int i;memset (&devs_opened,0 ,sizeof (devs_opened)); - devpriv->name[0 ] =0 ; +seq_buf_init (&s, devpriv->name,sizeof (devpriv->name));/* * Loop through all comedi devices specified on the command-line, * building our device list.
@@ -250,15 +252,9 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) } devpriv->devs = devs; devpriv->devs[devpriv->ndevs++] = bdev; - { -/* Append dev:subdev to devpriv->name */ -char buf[20 ]; -snprintf (buf,sizeof (buf),"%u:%u " , - bdev->minor, bdev->subdev); -strlcat (devpriv->name, buf, -sizeof (devpriv->name)); - } +/* Append dev:subdev to devpriv->name */ +seq_buf_printf (&s,"%u:%u " , bdev->minor, bdev->subdev); } }
@@ -267,6 +263,8 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)return -EINVAL ; } +seq_buf_str (&s); +return 0 ; }
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 7/28 scsi: bfa: Use snprintf() in bfa_fcs_fabric_psymb_init()
In reply to Bill WendlingSimilar to bfa_fcs_fabric_nsymb_init(), bfa_fcs_fabric_psymb_init() builds the port symbolic name using strscpy() and a chain of seven or eight strlcat() calls.
In preparation for removing the deprecated strlcat() API[1], replace the chained strscpy() and strlcat() calls with a single snprintf() call.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/scsi/bfa/bfa_fcs.c | 49 ++++++++++---------------------------- 1 file changed, 13 insertions(+), 36 deletions(-)
drivers/scsi/bfa/bfa_fcs.c +13 -36
@@ -760,49 +760,26 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)bfa_ioc_get_adapter_model (&fabric->fcs->bfa->ioc, model); -/* Model name/number */ -strscpy (port_cfg->sym_name.symname, model, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->sym_name.symname,BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); - -/* Driver Version */ -strlcat (port_cfg->sym_name.symname, driver_info->version, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->sym_name.symname,BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); - -/* Host machine name */ -strlcat (port_cfg->sym_name.symname, - driver_info->host_machine_name, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->sym_name.symname,BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); -/* * Host OS Info : * If OS Patch Info is not there, do not truncate any bytes from the * OS name string and instead copy the entire OS info string (64 bytes). */ if (driver_info->host_os_patch[0 ] =='\0' ) { -strlcat (port_cfg->sym_name.symname, - driver_info->host_os_name, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->sym_name.symname, -BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); +snprintf (port_cfg->sym_name.symname,BFA_SYMNAME_MAXLEN , +"%s%s%s%s%s%s%s%s" , + model,BFA_FCS_PORT_SYMBNAME_SEPARATOR , + driver_info->version,BFA_FCS_PORT_SYMBNAME_SEPARATOR , + driver_info->host_machine_name,BFA_FCS_PORT_SYMBNAME_SEPARATOR , + driver_info->host_os_name,BFA_FCS_PORT_SYMBNAME_SEPARATOR ); }else { -strlcat (port_cfg->sym_name.symname, - driver_info->host_os_name, -BFA_SYMNAME_MAXLEN ); -strlcat (port_cfg->sym_name.symname, -BFA_FCS_PORT_SYMBNAME_SEPARATOR , -BFA_SYMNAME_MAXLEN ); - -/* Append host OS Patch Info */ -strlcat (port_cfg->sym_name.symname, - driver_info->host_os_patch, -BFA_SYMNAME_MAXLEN ); +snprintf (port_cfg->sym_name.symname,BFA_SYMNAME_MAXLEN , +"%s%s%s%s%s%s%s%s%s" , + model,BFA_FCS_PORT_SYMBNAME_SEPARATOR , + driver_info->version,BFA_FCS_PORT_SYMBNAME_SEPARATOR , + driver_info->host_machine_name,BFA_FCS_PORT_SYMBNAME_SEPARATOR , + driver_info->host_os_name,BFA_FCS_PORT_SYMBNAME_SEPARATOR , + driver_info->host_os_patch); }/* null terminate */
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 8/28 devlink: Refactor strlcat() to seq_buf in __devlink_compat_running_version()
In reply to Bill Wendling__devlink_compat_running_version() appends running firmware version strings and spaces to "buf" inside nested netlink attribute loops using strlcat(), rescanning "buf" on every iteration.
In preparation for removing the deprecated strlcat() API[1], use struct seq_buf anchored at the current length of "buf" and append each version entry with seq_buf_printf().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- net/devlink/dev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/devlink/dev.c +6 -2
@@ -5,6 +5,7 @@*/ #include <linux/device.h> +#include <linux/seq_buf.h> #include <net/genetlink.h> #include <net/sock.h> #include "devl_internal.h"
@@ -1190,6 +1191,7 @@ static void __devlink_compat_running_version(struct devlink *devlink, {struct devlink_info_req req = {};const struct nlattr *nlattr; +struct seq_buf s;struct sk_buff *msg;int rem, err;
@@ -1202,6 +1204,9 @@ static void __devlink_compat_running_version(struct devlink *devlink,if (err) goto free_msg; +seq_buf_init (&s, buf, len); + s.len =strnlen (buf, len); +nla_for_each_attr_type (nlattr,DEVLINK_ATTR_INFO_VERSION_RUNNING , (void *)msg->data, msg->len, rem) {const struct nlattr *kv;
@@ -1209,8 +1214,7 @@ static void __devlink_compat_running_version(struct devlink *devlink,nla_for_each_nested_type (kv,DEVLINK_ATTR_INFO_VERSION_VALUE , nlattr, rem_kv) { -strlcat (buf,nla_data (kv), len); -strlcat (buf," " , len); +seq_buf_printf (&s,"%s " , (const char *)nla_data (kv)); } } free_msg:
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
[email protected]
AI reviewRe: [PATCH 08/28] devlink: Refactor strlcat() to seq_buf in __devlink_compat_running_version()
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] devlink: data truncation in ethtool fw_version due to seq_buf_init() --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] devlink: data truncation in ethtool fw_version due to seq_buf_init() --
commit 211bb0968eb0ca01b66de46e1d8900c3f0f30b64
Author: Bill Wendling <[email protected]>
devlink: Refactor strlcat() to seq_buf in __devlink_compat_running_version()
This commit replaces the deprecated strlcat() API in __devlink_compat_running_version() with struct seq_buf and seq_buf_printf() to append running firmware version strings.
Quoted 4 lines
net/devlink/dev.c +0
-0
[ ... ]
net/devlink/dev.c static void __devlink_compat_running_version(struct devlink *devlink, · line 1208
Quoted 6 lines
net/devlink/dev.c +2
-0@@ -1202,6 +1204,9 @@ static void __devlink_compat_running_version(struct devlink *devlink,if (err) goto free_msg; +seq_buf_init (&s, buf, len); + s.len =strnlen (buf, len);
[Severity: Medium]
Does this code inadvertently erase the existing contents of buf?
Looking at seq_buf_init(), it internally calls seq_buf_clear() which unconditionally sets the first byte of the buffer to a NUL character. As a result, the subsequent strnlen(buf, len) call will always evaluate to 0.
Since __devlink_compat_running_version() is meant to append devlink info to the buffer, wouldn't erasing it here lose the driver's native fw_version string that was previously populated by the driver's get_drvinfo() callback?
This could cause userspace applications calling ETHTOOL_GDRVINFO to receive only the devlink info instead of the expected concatenated native and devlink version string.
Quoted 13 lines
net/devlink/dev.c +1
-2nla_for_each_attr_type (nlattr,DEVLINK_ATTR_INFO_VERSION_RUNNING , (void *)msg->data, msg->len, rem) {const struct nlattr *kv;@@ -1209,8 +1214,7 @@ static void __devlink_compat_running_version(struct devlink *devlink,nla_for_each_nested_type (kv,DEVLINK_ATTR_INFO_VERSION_VALUE , nlattr, rem_kv) { -strlcat (buf,nla_data (kv), len); -strlcat (buf," " , len); +seq_buf_printf (&s,"%s " , (const char *)nla_data (kv)); } } free_msg:
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
PATCH 9/28 drm/dp_mst: Refactor build_mst_prop_path() to use seq_buf
In reply to Bill Wendlingbuild_mst_prop_path() constructs an MST property path by formatting port numbers into a temporary buffer and appending them to "proppath" with strlcat() in a loop.
In preparation for removing the deprecated strlcat() API[1], use struct seq_buf and seq_buf_printf() to format the path components directly into "proppath", eliminating the temporary buffer and repeated string scans.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/gpu/drm/display/drm_dp_mst_topology.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/display/drm_dp_mst_topology.c +9 -6
@@ -29,6 +29,7 @@#include <linux/kernel.h> #include <linux/random.h> #include <linux/sched.h> +#include <linux/seq_buf.h> #include <linux/seq_file.h> #if IS_ENABLED (CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS )
@@ -2216,19 +2217,21 @@ static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb, char *proppath, size_t proppath_size) { +struct seq_buf s;int i; -char temp[8 ]; -snprintf (proppath, proppath_size,"mst:%d" , mstb->mgr->conn_base_id); +seq_buf_init (&s, proppath, proppath_size); + +seq_buf_printf (&s,"mst:%d" , mstb->mgr->conn_base_id);for (i =0 ; i < (mstb->lct -1 ); i++) {int shift = (i %2 ) ?0 :4 ;int port_num = (mstb->rad[i /2 ] >> shift) &0xf ; -snprintf (temp,sizeof (temp),"-%d" , port_num); -strlcat (proppath, temp, proppath_size); +seq_buf_printf (&s,"-%d" , port_num); } -snprintf (temp,sizeof (temp),"-%d" , pnum); -strlcat (proppath, temp, proppath_size); +seq_buf_printf (&s,"-%d" , pnum); + +seq_buf_str (&s); }/**
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Re: [PATCH 09/28] drm/dp_mst: Refactor build_mst_prop_path() to use seq_buf
Also, out of curiosity - how exactly are you able to get this many email addresses in To: without your emails getting rejected? Because it is literally impossible to respond to this email with all of them, and this has been consistently kind of an issue when trying to submit patch series that do large refactors like this.
Quoted 175 lines · Bill Wendling
build_mst_prop_path()constructs an MST property path by formatting port
numbers into a temporary buffer and appending them to "proppath" withstrlcat()in a loop.In preparation for removing the deprecated
strlcat()API[1], use structseq_bufandseq_buf_printf()to format the path components directly into
"proppath", eliminating the temporary buffer and repeated string scans.Assisted-by Claude-3-5-Sonnet:20241022 [editor_update_file,
make_kernel_build_single_file]Signed-off-by Bill Wendling <[email protected]>---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/gpu/drm/display/drm_dp_mst_topology.c | 15 +++++++++------1 file changed, 9 insertions(+), 6 deletions(-)drivers/gpu/drm/display/drm_dp_mst_topology.c +1
-0@@ -29,6 +29,7 @@ #include <linux/kernel.h> #include <linux/random.h> #include <linux/sched.h> +#include <linux/seq_buf.h> #include <linux/seq_file.h>
#ifIS_ENABLED(CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS)drivers/gpu/drm/display/drm_dp_mst_topology.c +1
-1@@ -2216,19 +2217,21 @@ static void build_mst_prop_path(const structdrm_dp_mst_branch *mstb, char *proppath, size_t proppath_size) { + struct seq_buf s; int i; -char temp[8 ];drivers/gpu/drm/display/drm_dp_mst_topology.c +0
-1- snprintf(proppath, proppath_size, "mst:%d", mstb->mgr-Quoted 1 line
conn_base_id);drivers/gpu/drm/display/drm_dp_mst_topology.c +3
-0+seq_buf_init (&s, proppath, proppath_size); + +seq_buf_printf (&s,"mst:%d" , mstb->mgr->conn_base_id);for (i = 0; i < (
mstb->lct- 1); i++) {
int shift = (i % 2) ? 0 : 4;
intport_num= (mstb->rad[i / 2] >> shift) &0xf;drivers/gpu/drm/display/drm_dp_mst_topology.c +1
-2-snprintf (temp,sizeof (temp),"-%d" , port_num); -strlcat (proppath, temp, proppath_size); +seq_buf_printf (&s,"-%d" , port_num);}
drivers/gpu/drm/display/drm_dp_mst_topology.c +3
-2-snprintf (temp,sizeof (temp),"-%d" , pnum); -strlcat (proppath, temp, proppath_size); +seq_buf_printf (&s,"-%d" , pnum); + +seq_buf_str (&s);}
/**
PATCH 10/28 of/fdt: Replace strlcat() with snprintf() in early_init_dt_scan_chosen()
In reply to Bill WendlingWhen CONFIG_CMDLINE_EXTEND is enabled, early_init_dt_scan_chosen() uses two strlcat() calls to append a space and CONFIG_CMDLINE to the command line buffer.
In preparation for removing the deprecated strlcat() API[1], replace the strlcat() calls with a single snprintf() call using the existing string length.
Additionally, check for a NULL initial_boot_params pointer and jump to "handle_cmdline" so that CONFIG_CMDLINE handling still occurs without dereferencing a NULL FDT pointer in fdt_path_offset().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/of/fdt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/of/fdt.c +9 -2
@@ -1095,6 +1095,9 @@ int __init early_init_dt_scan_chosen(char *cmdline)const void *rng_seed;const void *fdt = initial_boot_params; +if (!fdt) + goto handle_cmdline; + node =fdt_path_offset (fdt,"/chosen" );if (node <0 ) node =fdt_path_offset (fdt,"/chosen@0" );
@@ -1133,8 +1136,12 @@ int __init early_init_dt_scan_chosen(char *cmdline)*/ #ifdef CONFIG_CMDLINE #if defined(CONFIG_CMDLINE_EXTEND ) -strlcat (cmdline," " ,COMMAND_LINE_SIZE ); -strlcat (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); + { +size_t len =strlen (cmdline); + +if (len <COMMAND_LINE_SIZE ) +snprintf (cmdline + len,COMMAND_LINE_SIZE - len," %s" ,CONFIG_CMDLINE ); + }#elif defined(CONFIG_CMDLINE_FORCE )strscpy (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE );#else
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Rob Herring
maintainerRe: [PATCH 10/28] of/fdt: Replace strlcat() with snprintf() in early_init_dt_scan_chosen()
Quoted 33 lines · Bill Wendling
When
CONFIG_CMDLINE_EXTENDis enabled,early_init_dt_scan_chosen()uses twostrlcat()calls to append a space andCONFIG_CMDLINEto the command line buffer.In preparation for removing the deprecated
strlcat()API[1], replace thestrlcat()calls with a singlesnprintf()call using the existing string length.Additionally, check for a NULL
initial_boot_paramspointer and jump to "handle_cmdline" so thatCONFIG_CMDLINEhandling still occurs without dereferencing a NULL FDT pointer infdt_path_offset().Assisted-by Assistant:Claude-3.5-Sonnet [editor_update_file, shell_command_run]Signed-off-by Bill Wendling <[email protected]>---
drivers/of/fdt.c +3
-0@@ -1095,6 +1095,9 @@ int __init early_init_dt_scan_chosen(char *cmdline)const void *rng_seed;const void *fdt = initial_boot_params; +if (!fdt) + goto handle_cmdline; + node =fdt_path_offset (fdt,"/chosen" );if (node <0 ) node =fdt_path_offset (fdt,"/chosen@0" );
drivers/of/fdt.c int __init early_init_dt_scan_chosen(char *cmdline) · line 1139
Quoted 6 lines
drivers/of/fdt.c +1
-2@@ -1133,8 +1136,12 @@ int __init early_init_dt_scan_chosen(char *cmdline)*/ #ifdef CONFIG_CMDLINE #if defined(CONFIG_CMDLINE_EXTEND) -strlcat (cmdline," " ,COMMAND_LINE_SIZE ); -strlcat (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); + {
No need for brackets.
Quoted 11 lines
drivers/of/fdt.c +5
-0+size_t len =strlen (cmdline); + +if (len <COMMAND_LINE_SIZE ) + snprintf(cmdline + len, COMMAND_LINE_SIZE - len, " %s", CONFIG_CMDLINE); + }#elif defined(CONFIG_CMDLINE_FORCE)strscpy (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE );#else Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 11/28 wifi: brcmfmac: Replace strlcat() with snprintf() in brcmf_fw_alloc_request()
In reply to Bill Wendlingbrcmf_fw_alloc_request() constructs firmware file paths by chaining strscpy() and multiple strlcat() calls for the module parameter path, separator, base name, and extension.
In preparation for removing the deprecated strlcat() API[1], format the complete firmware path in a single snprintf() call.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- .../broadcom/brcm80211/brcmfmac/firmware.c | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +8 -13
@@ -845,22 +845,17 @@ brcmf_fw_alloc_request(u32 chip, u32 chiprev, fwreq->n_items = n_fwnames;for (j =0 ; j < n_fwnames; j++) { - fwreq->items[j].path = fwnames[j].path; - fwnames[j].path[0 ] ='\0' ;/* check if firmware path is provided by module parameter */ if (brcmf_mp_global.firmware_path[0 ] !='\0' ) { -strscpy (fwnames[j].path, mp_path, -BRCMF_FW_NAME_LEN ); - -if (end !='/' ) { -strlcat (fwnames[j].path,"/" , -BRCMF_FW_NAME_LEN ); - } +snprintf (fwnames[j].path,BRCMF_FW_NAME_LEN ,"%s%s%s%s" , + mp_path, (end =='/' ) ?"" :"/" , + mapping_table[i].fw_base, + fwnames[j].extension); + }else { +snprintf (fwnames[j].path,BRCMF_FW_NAME_LEN ,"%s%s" , + mapping_table[i].fw_base, + fwnames[j].extension); } -strlcat (fwnames[j].path, mapping_table[i].fw_base, -BRCMF_FW_NAME_LEN ); -strlcat (fwnames[j].path, fwnames[j].extension, -BRCMF_FW_NAME_LEN ); fwreq->items[j].path = fwnames[j].path; }
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 12/28 fortify: Convert strlcat() to snprintf() in strcat()
In reply to Bill WendlingThe fortified implementation of strcat() in include/linux/fortify-string.h currently relies on strlcat() to perform bounded concatenation and detect buffer overflows.
In preparation for removing the deprecated strlcat() API[1], replace the strlcat() call in strcat(). When the destination buffer size is unknown (SIZE_MAX), call __underlying_strcat() directly. Otherwise, determine the destination length with __fortify_strlen() and append the source string using __builtin_snprintf(), preserving the existing fortify_panic() check on overflow.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- include/linux/fortify-string.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
include/linux/fortify-string.h +6 -1
@@ -363,7 +363,12 @@ __FORTIFY_INLINE __diagnose_as(__builtin_strcat, 1, 2) char *strcat(char * const POS p, const char *q) {const size_t p_size =__member_size (p); -const size_t wanted =strlcat (p, q, p_size); + +if (p_size ==SIZE_MAX ) +return __underlying_strcat (p, q); + +const size_t p_len =__fortify_strlen (p); +const size_t wanted = p_len +__builtin_snprintf (p + p_len, p_size - p_len,"%s" , q);if (p_size <= wanted)fortify_panic (FORTIFY_FUNC_strcat,FORTIFY_WRITE , p_size, wanted +1 , p);
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
[email protected]
AI reviewRe: [PATCH 12/28] fortify: Convert strlcat() to snprintf() in strcat()
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] fortify: strcat using snprintf causes major performance regression - [High] fortify: snprintf in…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] fortify: strcat using snprintf causes major performance regression
- [High] fortify: snprintf in strcat bypasses FORTIFY_READ bounds on source --
commit d5360c3f44eeb8b6f9cd8cc195950107cbfe6556
Author: Bill Wendling <[email protected]>
fortify: Convert strlcat() to snprintf() in strcat()
Replaces the strlcat() implementation inside strcat() with __builtin_snprintf() when the destination size is known, and falls back to __underlying_strcat() otherwise. This prepares for the removal of the deprecated strlcat() API.
include/linux/fortify-string.h __FORTIFY_INLINE __diagnose_as(__builtin_strcat, 1, 2) · line 368
Quoted 12 lines
include/linux/fortify-string.h +3
-1@@ -363,7 +363,12 @@ __FORTIFY_INLINE __diagnose_as(__builtin_strcat, 1, 2) char *strcat(char * const POS p, const char *q) {const size_t p_size =__member_size (p); -const size_t wanted =strlcat (p, q, p_size); + +if (p_size ==SIZE_MAX ) +return __underlying_strcat (p, q);
[Severity: High]
Does falling back to the unfortified __underlying_strcat() directly here skip the FORTIFY_READ bounds checks on the source string q?
The previous strlcat() fallback delegated to __fortify_strlen(q), which safely bounded the read and triggered a panic if q was not NUL-terminated within its allocation. Could this bypass allow unbounded reads if q lacks a NUL terminator?
include/linux/fortify-string.h __FORTIFY_INLINE __diagnose_as(__builtin_strcat, 1, 2) · line 371
Quoted 3 lines
include/linux/fortify-string.h +3
-0+ +const size_t p_len =__fortify_strlen (p); +const size_t wanted = p_len +__builtin_snprintf (p + p_len, p_size - p_len,"%s" , q);
[Severity: High]
Will injecting __builtin_snprintf() for a fundamental string primitive like strcat() cause a significant performance regression and stack bloat?
Because the size parameter is dynamic, the compiler cannot optimize this away, meaning this will call into the heavy vsnprintf() format parsing engine.
Given that vsnprintf() has a notoriously large stack footprint, could this increase the risk of kernel stack overflows in deep call chains?
Additionally, does passing q as an opaque variadic argument to snprintf() defeat the compiler's __builtin_object_size() tracking?
Since the vsnprintf() engine will process "%s" using an unbounded strlen(q), could this bypass the intended FORTIFY_READ mitigation and leak information or crash if q is missing a NUL terminator?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
PATCH 13/28 i40e: Replace strlcat() with snprintf() in i40e_nvm_version_str()
In reply to Bill Wendlingi40e_nvm_version_str() uses strlcat() to optionally append the EETrackID and combo image version strings to the NVM version buffer.
In preparation for removing the deprecated strlcat() API[1], replace these strlcat() calls with bounded snprintf() calls at the current end of the buffer.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/net/ethernet/intel/i40e/i40e.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +11 -4
@@ -1059,19 +1059,26 @@ static inline char *i40e_nvm_version_str(struct i40e_hw *hw, char *buf, size_t len) {char ver[16 ] =" " ; +size_t offset;/* Get NVM version */ i40e_info_nvm_ver (hw, buf, len);/* Append EETrackID if provided */ i40e_info_eetrack (hw, &ver[1 ],sizeof (ver) -1 ); -if (strlen (ver) >1 ) -strlcat (buf, ver, len); +if (strlen (ver) >1 ) { + offset =strlen (buf); +if (offset < len) +snprintf (buf + offset, len - offset,"%s" , ver); + }/* Append combo image version if provided */ i40e_info_civd_ver (hw, &ver[1 ],sizeof (ver) -1 ); -if (strlen (ver) >1 ) -strlcat (buf, ver, len); +if (strlen (ver) >1 ) { + offset =strlen (buf); +if (offset < len) +snprintf (buf + offset, len - offset,"%s" , ver); + }return buf; }
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 14/28 ALSA: usb-audio: Refactor append_ctl_name() to use snprintf()
In reply to Bill WendlingIn preparation for removing the deprecated strlcat() API[1], replace the strlcat() call in append_ctl_name() with strlen() and snprintf(), preserving its return value semantics (the total length of the string it attempted to create).
Also replace an open-coded strlcat() call in build_connector_control() with append_ctl_name().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- sound/usb/mixer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/usb/mixer.c +6 -2
@@ -1722,7 +1722,11 @@ const struct snd_kcontrol_new *snd_usb_feature_unit_ctl = &usb_feature_unit_ctl;*/ static size_t append_ctl_name (struct snd_kcontrol *kctl,const char *str) { -return strlcat (kctl->id.name, str,sizeof (kctl->id.name)); +size_t len =strlen (kctl->id.name); + +if (len >=sizeof (kctl->id.name)) +return len +strlen (str); +return len +snprintf (kctl->id.name + len,sizeof (kctl->id.name) - len,"%s" , str); }/*
@@ -2090,7 +2094,7 @@ static void build_connector_control(struct usb_mixer_interface *mixer, }if (check_mapped_name (map, kctl->id.name,sizeof (kctl->id.name))) -strlcat (kctl->id.name," Jack" ,sizeof (kctl->id.name)); +append_ctl_name (kctl," Jack" );else get_connector_control_name (mixer, term, is_input, kctl->id.name,sizeof (kctl->id.name));
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 15/28 orangefs: Use seq_buf for debug help string generation
In reply to Bill Wendlingorangefs_prepare_debugfs_help_string() constructs the debugfs help text in a dynamically allocated buffer using repeated strlcat() calls across keyword loops, rescanning the buffer on every append.
In preparation for removing the deprecated strlcat() API[1], use struct seq_buf to build the help string. This tracks the write position across the loops, allows formatting each keyword line with a single seq_buf_printf() call, and checks for truncation via seq_buf_has_overflowed().
Additionally, replace the final strlcat() call that copies the completed string into debug_help_string with strscpy().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- fs/orangefs/orangefs-debugfs.c | 36 +++++++++++++--------------------- 1 file changed, 14 insertions(+), 22 deletions(-)
fs/orangefs/orangefs-debugfs.c +14 -22
@@ -37,6 +37,7 @@*/ #include <linux/debugfs.h> #include <linux/slab.h> +#include <linux/seq_buf.h> #include <linux/uaccess.h>
@@ -623,10 +624,10 @@ int orangefs_prepare_debugfs_help_string(int at_boot)char *client_title ="Client Debug Keywords:\n" ;char *kernel_title ="Kernel Debug Keywords:\n" ;size_t string_size =DEBUG_HELP_STRING_SIZE ; -size_t result_size;size_t i;char *new;int rc = -EINVAL ; +struct seq_buf s;gossip_debug (GOSSIP_UTILS_DEBUG ,"%s: start\n" , __func__);
@@ -640,17 +641,14 @@ int orangefs_prepare_debugfs_help_string(int at_boot) goto out; } +seq_buf_init (&s, new, string_size); +/* -* strlcat(dst, src, size) will append at most -* "size - strlen(dst) - 1" bytes of src onto dst, -* null terminating the result, and return the total -* length of the string it tried to create. -* * We'll just plow through here building our new debug -* help string and let strlcat take care of assuring that +* help string and let seq_buf take care of assuring that * dst doesn't overflow. */ -strlcat (new, client_title, string_size); +seq_buf_puts (&s, client_title);if (!at_boot) {
@@ -665,24 +663,18 @@ int orangefs_prepare_debugfs_help_string(int at_boot) goto out; } -for (i =0 ; i < cdm_element_count; i++) { -strlcat (new,"\t" , string_size); -strlcat (new, cdm_array[i].keyword, string_size); -strlcat (new,"\n" , string_size); - } +for (i =0 ; i < cdm_element_count; i++) +seq_buf_printf (&s,"\t%s\n" , cdm_array[i].keyword); } -strlcat (new,"\n" , string_size); -strlcat (new, kernel_title, string_size); +seq_buf_puts (&s,"\n" ); +seq_buf_puts (&s, kernel_title); -for (i =0 ; i < num_kmod_keyword_mask_map; i++) { -strlcat (new,"\t" , string_size); -strlcat (new, s_kmod_keyword_mask_map[i].keyword, string_size); - result_size =strlcat (new,"\n" , string_size); - } +for (i =0 ; i < num_kmod_keyword_mask_map; i++) +seq_buf_printf (&s,"\t%s\n" , s_kmod_keyword_mask_map[i].keyword);/* See if we tried to put too many bytes into "new"... */ -if (result_size >= string_size) { +if (seq_buf_has_overflowed (&s)) {kfree (new); goto out; }
@@ -692,7 +684,7 @@ int orangefs_prepare_debugfs_help_string(int at_boot) }else {mutex_lock (&orangefs_help_file_lock);memset (debug_help_string,0 ,DEBUG_HELP_STRING_SIZE ); -strlcat (debug_help_string, new, string_size); +strscpy (debug_help_string, new,DEBUG_HELP_STRING_SIZE );mutex_unlock (&orangefs_help_file_lock);kfree (new); }
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Mike Marshall
maintainerRe: [PATCH 15/28] orangefs: Use seq_buf for debug help string generation
I compiled your patch onto 7.3-rc3 and ran my
orangefs debugfs xfstest through it. The changes
look good to me.
-Mike
Quoted 223 lines · Bill Wendling
orangefs_prepare_debugfs_help_string()constructs the debugfs help text in a dynamically allocated buffer using repeatedstrlcat()calls across keyword loops, rescanning the buffer on every append.In preparation for removing the deprecated
strlcat()API[1], use structseq_bufto build the help string. This tracks the write position across the loops, allows formatting each keyword line with a singleseq_buf_printf()call, and checks for truncation viaseq_buf_has_overflowed().Additionally, replace the final
strlcat()call that copies the completed string intodebug_help_stringwithstrscpy().Assisted-by Gemini:gemini-2.0-flash-exp [shell_command_run, editor_update_file]Signed-off-by Bill Wendling <[email protected]>---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- fs/orangefs/orangefs-debugfs.c | 36 +++++++++++++--------------------- 1 file changed, 14 insertions(+), 22 deletions(-)fs/orangefs/orangefs-debugfs.c +14
-23@@ -37,6 +37,7 @@*/ #include <linux/debugfs.h> #include <linux/slab.h> +#include <linux/seq_buf.h> #include <linux/uaccess.h> @@ -623,10 +624,10 @@ int orangefs_prepare_debugfs_help_string(int at_boot)char *client_title ="Client Debug Keywords:\n" ;char *kernel_title ="Kernel Debug Keywords:\n" ;size_t string_size =DEBUG_HELP_STRING_SIZE ; -size_t result_size;size_t i;char *new;int rc = -EINVAL ; +struct seq_buf s;gossip_debug (GOSSIP_UTILS_DEBUG ,"%s: start\n" , __func__);@@ -640,17 +641,14 @@ int orangefs_prepare_debugfs_help_string(int at_boot) goto out; } +seq_buf_init (&s, new, string_size); +/* -* strlcat(dst, src, size) will append at most -* "size - strlen(dst) - 1" bytes of src onto dst, -* null terminating the result, and return the total -* length of the string it tried to create. -* * We'll just plow through here building our new debug -* help string and let strlcat take care of assuring that +* help string and let seq_buf take care of assuring that * dst doesn't overflow. */ -strlcat (new, client_title, string_size); +seq_buf_puts (&s, client_title);if (!at_boot) {@@ -665,24 +663,18 @@ int orangefs_prepare_debugfs_help_string(int at_boot) goto out; } -for (i =0 ; i < cdm_element_count; i++) { -strlcat (new,"\t" , string_size); -strlcat (new, cdm_array[i].keyword, string_size); -strlcat (new,"\n" , string_size); - } +for (i =0 ; i < cdm_element_count; i++) +seq_buf_printf (&s,"\t%s\n" , cdm_array[i].keyword); } -strlcat (new,"\n" , string_size); -strlcat (new, kernel_title, string_size); +seq_buf_puts (&s,"\n" ); +seq_buf_puts (&s, kernel_title); -for (i =0 ; i < num_kmod_keyword_mask_map; i++) { -strlcat (new,"\t" , string_size); -strlcat (new, s_kmod_keyword_mask_map[i].keyword, string_size); - result_size =strlcat (new,"\n" , string_size); - } +for (i =0 ; i < num_kmod_keyword_mask_map; i++) +seq_buf_printf (&s,"\t%s\n" , s_kmod_keyword_mask_map[i].keyword);/* See if we tried to put too many bytes into "new"... */ -if (result_size >= string_size) { +if (seq_buf_has_overflowed (&s)) {kfree (new); goto out; }@@ -692,7 +684,7 @@ int orangefs_prepare_debugfs_help_string(int at_boot) }else {mutex_lock (&orangefs_help_file_lock);memset (debug_help_string,0 ,DEBUG_HELP_STRING_SIZE ); -strlcat (debug_help_string, new, string_size); +strscpy (debug_help_string, new,DEBUG_HELP_STRING_SIZE );mutex_unlock (&orangefs_help_file_lock);kfree (new); } --2.55.0.1032.g73a4cd73de-goog
PATCH 16/28 pinctrl: samsung: Use snprintf() to construct pin bank names
In reply to Bill Wendlingsamsung_banks_node_get() constructs each pin bank node name by copying bank->name with strscpy() and appending the suffix with strlcat().
In preparation for removing the deprecated strlcat() API[1], format the node name in a single snprintf() call, which preserves the existing truncation check against sizeof(node_name).
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/pinctrl/samsung/pinctrl-samsung.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/samsung/pinctrl-samsung.c +1 -2
@@ -1155,8 +1155,7 @@ static void samsung_banks_node_get(struct device *dev, struct samsung_pinctrl_dr bank = d->pin_banks;for (i =0 ; i < d->nr_banks; ++i, ++bank) { -strscpy (node_name, bank->name,sizeof (node_name)); - len =strlcat (node_name, suffix,sizeof (node_name)); + len =snprintf (node_name,sizeof (node_name),"%s%s" , bank->name, suffix);if (len >=sizeof (node_name)) {dev_err (dev,"Too long pin bank name '%s', ignoring\n" , bank->name);
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
RE: [PATCH 16/28] pinctrl: samsung: Use snprintf() to construct pin bank names
Quoted 218 lines
-----Original Message-----
From: Bill Wendling <[email protected]>
Sent: Tuesday, September 15, 2026 10:19 AM
To: [email protected]
Cc: Bill Wendling <[email protected]>; codemender- [email protected]; Russell King <[email protected]>; Huacai Chen <[email protected]>; WANG Xuerui <[email protected]>; Thomas Bogendoerfer <[email protected]>; James E.J. Bottomley <[email protected]>; Helge Deller <[email protected]>; Thomas Gleixner <[email protected]>; Ingo Molnar <[email protected]>; Borislav Petkov <[email protected]>; Dave Hansen <[email protected]>; [email protected]; H. Peter Anvin <[email protected]>; Ian Abbott <[email protected]>; H Hartley Sweeten <[email protected]>; Luck, Tony <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; David Airlie <[email protected]>; Simona Vetter <[email protected]>; Brost, Matthew <[email protected]>; Thomas Hellström <[email protected]>; Vivi, Rodrigo <[email protected]>; Dmitry Torokhov <[email protected]>; Matthias Schwarzott <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Arend van Spriel <[email protected]>; Rob Herring <[email protected]>; Saravana Kannan <[email protected]>; Krzysztof Kozlowski <[email protected]>; Sylwester Nawrocki <[email protected]>; Peter Griffin <[email protected]>; Alim Akhtar <[email protected]>; Linus Walleij <[email protected]>; Anil Gurumurthy <[email protected]>; Sudarsana Kalluru <[email protected]>; Martin K. Petersen <[email protected]>; Trond Myklebust <[email protected]>; Anna Schumaker <[email protected]>; Mike Marshall <[email protected]>; Martin Brandenburg <[email protected]>; Kees Cook <[email protected]>; Jiri Pirko <[email protected]>; Simon Horman <[email protected]>; Chuck Lever <[email protected]>; Jeff Layton <[email protected]>; NeilBrown <[email protected]>; Olga Kornievskaia <[email protected]>; Dai Ngo <[email protected]>; Tom Talpey <[email protected]>; Jaroslav Kysela <[email protected]>; Takashi Iwai <[email protected]>; Andrew Morton <[email protected]>; Mike Rapoport (Microsoft) <[email protected]>; Kanglong Wang <[email protected]>; Tiezhu Yang <[email protected]>; Qiang Ma <[email protected]>; Randy Dunlap <[email protected]>; Pengpeng Hou <[email protected]>; Ard Biesheuvel <[email protected]>; Breno Leitao <[email protected]>; Thorsten Blum <[email protected]>; Harshit Mogalapalli <[email protected]>; Greg Kroah-Hartman <[email protected]>; Lyude Paul <[email protected]>; Ashutosh Desai <[email protected]>; Deak, Imre <[email protected]>; Dmitry Baryshkov <[email protected]>; Johan Hovold <[email protected]>; Berg, Johannes <[email protected]>; Korenblit, Miriam Rachel <[email protected]>; Alexander Stein <[email protected]>; Cryolitia PukNgae <[email protected]>; Jiaming Zhang <[email protected]>; Will Porter <[email protected]>; Cen Zhang <[email protected]>; Cássio Gabriel <[email protected]>; Rong Zhang <[email protected]>; Arun Raghavan <[email protected]>; linux-arm- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; intel- [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH 16/28] pinctrl: samsung: Usesnprintf()to construct pin bank names
samsung_banks_node_get()constructs each pin bank node name by copyingbank->namewithstrscpy()and appending the suffix withstrlcat().In preparation for removing the deprecated
strlcat()API[1], format the node name in a singlesnprintf()call, which preserves the existing truncation check againstsizeof(node_name).Assisted-by Gemini:Pro [editor_update_file,
make_kernel_build_single_file,checkpatch_run]Signed-off-by Bill Wendling <[email protected]>---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- drivers/pinctrl/samsung/pinctrl-samsung.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/pinctrl/samsung/pinctrl-samsung.c +2
-2@@ -1155,8 +1155,7 @@ static void samsung_banks_node_get(struct device *dev, struct samsung_pinctrl_dr bank = d->pin_banks;for (i =0 ; i < d->nr_banks; ++i, ++bank) { -strscpy (node_name, bank->name,sizeof (node_name)); - len =strlcat (node_name, suffix,sizeof (node_name)); + len =snprintf (node_name,sizeof (node_name),"%s%s" , bank->name, +suffix);if (len >=sizeof (node_name)) { dev_err(dev, "Too long pin bank name '%s',
Quoted 4 lines
ignoring\n",
bank->name);
--
2.55.0.1032.g73a4cd73de-goog
PATCH 17/28 MIPS: cmdline: Refactor bootcmdline_append() to use snprintf()
In reply to Bill Wendlingbootcmdline_append() passes "max" (the maximum length of the source string "s") as the destination buffer size argument to strlcat(). Because strlcat() expects the total size of the destination buffer (COMMAND_LINE_SIZE), it fails to append anything whenever "max" is smaller than the current length of boot_command_line, and could overflow boot_command_line if "max" exceeds COMMAND_LINE_SIZE.
In preparation for removing the deprecated strlcat() API[1], replace the strlcat() calls with snprintf() using the "%.*s" precision specifier. This bounds the read from "s" to at most "max" bytes while properly respecting the remaining space in boot_command_line.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- arch/mips/kernel/setup.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
arch/mips/kernel/setup.c +18 -3
@@ -518,13 +518,28 @@ static void __init check_kernel_sections_mem(void)static void __init bootcmdline_append (const char *s,size_t max) { +size_t len; +int prec; +if (!s[0 ] || !max)return ; -if (boot_command_line[0 ]) -strlcat (boot_command_line," " ,COMMAND_LINE_SIZE ); + len =strlen (boot_command_line); +if (len >=COMMAND_LINE_SIZE -1 ) +return ; -strlcat (boot_command_line, s, max); +if (len) { +if (COMMAND_LINE_SIZE - len <3 ) +return ; + + prec =min_t (size_t, max,COMMAND_LINE_SIZE - len -2 ); +snprintf (boot_command_line + len,COMMAND_LINE_SIZE - len," %.*s" , + prec, s); + }else { + prec =min_t (size_t, max,COMMAND_LINE_SIZE -1 ); +snprintf (boot_command_line,COMMAND_LINE_SIZE ,"%.*s" , + prec, s); + } }#ifdef CONFIG_OF_EARLY_FLATTREE
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 18/28 LoongArch: Refactor bootcmdline_init() to use seq_buf instead of strlcat()
In reply to Bill Wendlingbootcmdline_init() uses multiple strlcat() calls to append init_command_line or CONFIG_CMDLINE to boot_command_line.
In preparation for removing the deprecated strlcat() API[1], initialize a struct seq_buf with the existing contents of boot_command_line and use seq_buf_puts() to append the command line fragments.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- arch/loongarch/kernel/setup.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
arch/loongarch/kernel/setup.c +15 -7
@@ -33,6 +33,7 @@#include <linux/of_address.h> #include <linux/suspend.h> #include <linux/swiotlb.h> +#include <linux/seq_buf.h> #include <asm/addrspace.h> #include <asm/alternative.h>
@@ -305,6 +306,8 @@ static void __init fdt_setup(void)static void __init bootcmdline_init (char **cmdline_p) { +struct seq_buf s; +/* * If CONFIG_CMDLINE_FORCE is enabled then initializing the command line * is trivial - we simply use the built-in command line unconditionally &
@@ -315,6 +318,11 @@ static void __init bootcmdline_init(char **cmdline_p) goto out; } +/* Initialize seq_buf pointing to boot_command_line */ + s.buffer = boot_command_line; + s.size =COMMAND_LINE_SIZE ; + s.len =strlen (boot_command_line); +#ifdef CONFIG_OF_FLATTREE /* * If CONFIG_CMDLINE_BOOTLOADER is enabled and we are in FDT-based system,
@@ -323,11 +331,11 @@ static void __init bootcmdline_init(char **cmdline_p)* to boot_command_line. */ if (initial_boot_params) { -if (boot_command_line[0 ]) -strlcat (boot_command_line," " ,COMMAND_LINE_SIZE ); +if (s.len) +seq_buf_puts (&s," " ); -if (!strstr (boot_command_line, init_command_line)) -strlcat (boot_command_line, init_command_line,COMMAND_LINE_SIZE ); +if (!strstr (s.buffer, init_command_line)) +seq_buf_puts (&s, init_command_line); goto out; }
@@ -338,14 +346,14 @@ static void __init bootcmdline_init(char **cmdline_p)* CONFIG_CMDLINE_EXTEND is enabled. */ if (IS_ENABLED (CONFIG_CMDLINE_EXTEND ) &&CONFIG_CMDLINE [0 ]) { -strlcat (boot_command_line," " ,COMMAND_LINE_SIZE ); -strlcat (boot_command_line,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); +seq_buf_puts (&s," " ); +seq_buf_puts (&s,CONFIG_CMDLINE ); }/* * Use built-in command line if the bootloader command line is empty. */ -if (IS_ENABLED (CONFIG_CMDLINE_BOOTLOADER ) && !boot_command_line[0 ]) +if (IS_ENABLED (CONFIG_CMDLINE_BOOTLOADER ) && !s.len)strscpy (boot_command_line,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); out:
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 19/28 x86/setup: Use snprintf() to concatenate builtin and boot command lines
In reply to Bill WendlingWhen CONFIG_CMDLINE_BOOL is enabled without CONFIG_CMDLINE_OVERRIDE, setup_arch() appends boot_command_line to builtin_cmdline using two strlcat() calls before copying the result back to boot_command_line.
In preparation for removing the deprecated strlcat() API[1], format the combined command line into a temporary buffer using a single snprintf() call and copy the result to both builtin_cmdline and boot_command_line. Using a temporary buffer avoids undefined behavior from passing overlapping source and destination buffers to snprintf().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- arch/x86/kernel/setup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/x86/kernel/setup.c +5 -3
@@ -916,9 +916,11 @@ void __init setup_arch(char **cmdline_p)#else if (builtin_cmdline[0 ]) {/* append boot loader cmdline to builtin */ -strlcat (builtin_cmdline," " ,COMMAND_LINE_SIZE ); -strlcat (builtin_cmdline, boot_command_line,COMMAND_LINE_SIZE ); -strscpy (boot_command_line, builtin_cmdline,COMMAND_LINE_SIZE ); +char tmp[COMMAND_LINE_SIZE ]; + +snprintf (tmp,COMMAND_LINE_SIZE ,"%s %s" , builtin_cmdline, boot_command_line); +strscpy (builtin_cmdline, tmp,COMMAND_LINE_SIZE ); +strscpy (boot_command_line, tmp,COMMAND_LINE_SIZE ); }#endif builtin_cmdline_added = true;
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
[email protected]
AI reviewRe: [PATCH 19/28] x86/setup: Use snprintf() to concatenate builtin and boot command lines
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] x86/setup: stack frame size exceeded in setup_arch() --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] x86/setup: stack frame size exceeded in setup_arch()
--
commit 77de53f82acddaba0d28234aa8f72d7d99b20943
Author: Bill Wendling <[email protected]>
x86/setup: Use snprintf() to concatenate builtin and boot command lines
This commit replaces multiple strlcat() calls with a single snprintf() call in setup_arch() to concatenate the builtin and boot command lines. It uses a temporary buffer to avoid undefined behavior from overlapping source and destination buffers, preparing for the removal of the deprecated strlcat() API.
arch/x86/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 919
Quoted 11 lines
arch/x86/kernel/setup.c +1
-3@@ -916,9 +916,11 @@ void __init setup_arch(char **cmdline_p)#else if (builtin_cmdline[0 ]) {/* append boot loader cmdline to builtin */ -strlcat (builtin_cmdline," " ,COMMAND_LINE_SIZE ); -strlcat (builtin_cmdline, boot_command_line,COMMAND_LINE_SIZE ); -strscpy (boot_command_line, builtin_cmdline,COMMAND_LINE_SIZE ); +char tmp[COMMAND_LINE_SIZE ];
[Severity: Low]
Will this unconditionally trigger a -Wframe-larger-than warning during build?
COMMAND_LINE_SIZE is 2048 on x86_64, which matches the default warning threshold for stack frames (CONFIG_FRAME_WARN).
Combined with the function overhead and other local variables, allocating this array directly on the stack will reliably exceed the limit and break builds that have CONFIG_WERROR enabled.
Quoted 7 lines
arch/x86/kernel/setup.c +4
-0+ +snprintf (tmp,COMMAND_LINE_SIZE ,"%s %s" , builtin_cmdline, boot_command_line); +strscpy (builtin_cmdline, tmp,COMMAND_LINE_SIZE ); + strscpy(boot_command_line, tmp, COMMAND_LINE_SIZE); }#endif builtin_cmdline_added = true;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=19
PATCH 20/28 parisc: Refactor strlcat() to seq_buf in setup_cmdline()
In reply to Bill Wendlingsetup_cmdline() uses multiple strlcat() calls to conditionally append default console and earlycon parameters to boot_command_line.
In preparation for removing the deprecated strlcat() API[1], initialize a struct seq_buf with the existing boot_command_line contents and use seq_buf_printf() to append the console parameters.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- arch/parisc/kernel/setup.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
arch/parisc/kernel/setup.c +10 -6
@@ -17,6 +17,7 @@#include <linux/init.h> #include <linux/console.h> #include <linux/seq_file.h> +#include <linux/seq_buf.h> #define PCI_DEBUG #include <linux/pci.h> #undef PCI_DEBUG
@@ -42,6 +43,7 @@ static char __initdata command_line[COMMAND_LINE_SIZE];static void __init setup_cmdline (char **cmdline_p) {extern unsigned int boot_args[]; +struct seq_buf s;char *p; *cmdline_p = command_line;
@@ -54,19 +56,21 @@ static void __init setup_cmdline(char **cmdline_p)strscpy (boot_command_line, (char *)__va (boot_args[1 ]),COMMAND_LINE_SIZE ); + s.buffer = boot_command_line; + s.size =COMMAND_LINE_SIZE ; + s.len =strlen (boot_command_line); +/* autodetect console type (if not done by palo yet) */ p = boot_command_line;if (!str_has_prefix (p,"console=" ) && !strstr (p," console=" )) { -strlcat (p," console=" ,COMMAND_LINE_SIZE ); -if (PAGE0 ->mem_cons.cl_class ==CL_DUPLEX ) -strlcat (p,"ttyS0" ,COMMAND_LINE_SIZE ); -else -strlcat (p,"tty0" ,COMMAND_LINE_SIZE ); +seq_buf_printf (&s," console=%s" , +PAGE0 ->mem_cons.cl_class ==CL_DUPLEX ? +"ttyS0" :"tty0" ); }/* default to use early console */ if (!strstr (p,"earlycon" )) -strlcat (p," earlycon=pdc" ,COMMAND_LINE_SIZE ); +seq_buf_printf (&s," earlycon=pdc" );#ifdef CONFIG_BLK_DEV_INITRD /* did palo pass us a ramdisk? */
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 21/28 NFS: nfsroot: Refactor root_nfs_cat() to use snprintf()
In reply to Bill Wendlingroot_nfs_cat() computes the length of "dest" with strlen(), but then uses up to two strlcat() calls to append a comma separator and "src", rescanning "dest" each time.
In preparation for removing the deprecated strlcat() API[1], use the already-computed length and a single snprintf() call to append the optional comma and "src", returning -1 if the result is truncated.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- fs/nfs/nfsroot.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
fs/nfs/nfsroot.c +7 -4
@@ -173,12 +173,15 @@ static int __init root_nfs_cat(char *dest, const char *src, const size_t destlen) {size_t len =strlen (dest); +int ret; -if (len && dest[len -1 ] !=',' ) -if (strlcat (dest,"," , destlen) >= destlen) -return -1 ; +if (len >= destlen) +return -1 ; -if (strlcat (dest, src, destlen) >= destlen) + ret =snprintf (dest + len, destlen - len,"%s%s" , + (len && dest[len -1 ] !=',' ) ?"," :"" , src); + +if (ret <0 || ret >= destlen - len)return -1 ;return 0 ; }
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Kees Cook
maintainerRe: [PATCH 21/28] NFS: nfsroot: Refactor root_nfs_cat() to use snprintf()
Quoted 2 lines · Bill Wendling
fs/nfs/nfsroot.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
This collides with:
https://lore.kernel.org/all/27956255dde39f58d73a7b51cb53cbe3d7804f54.1786411026.git.mariianikitash@google.com/
fs/nfs/nfsroot.c static int __init root_nfs_cat(char *dest, const char *src, · line 182
Quoted 2 lines
fs/nfs/nfsroot.c +2
-0+ ret =snprintf (dest + len, destlen - len,"%s%s" , + (len && dest[len -1 ] !=',' ) ?"," :"" , src);
I prefer Mariia's version because this inline ternary is difficult to read.
I was expecting to land hers soon if the NFS folks don't pipe up. It is one of the rare cases of still being open-coded, but the strlen() usage was pre-existing to check for the trailing comma, so it's not a clean seq_buf() conversion candidate...
Signature · 1 line
Kees Cook
Re: [PATCH 21/28] NFS: nfsroot: Refactor root_nfs_cat() to use snprintf()
Quoted 5 lines · Kees Cook
Quoted 2 lines · Bill Wendling
fs/nfs/nfsroot.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
Quoted 9 lines
This collides with:
https://lore.kernel.org/all/27956255dde39f58d73a7b51cb53cbe3d7804f54.1786411026.git.mariianikitash@google.com/fs/nfs/nfsroot.c static int __init root_nfs_cat(char *dest, const char *src, · line 182
Quoted 2 lines
fs/nfs/nfsroot.c +2
-0+ ret =snprintf (dest + len, destlen - len,"%s%s" , + (len && dest[len -1 ] !=',' ) ?"," :"" , src);I prefer Mariia's version because this inline ternary is difficult to read.
Agreed. I was trying to not stomp on her work. Please ignore this patch.
-bw
Quoted 7 lines
I was expecting to land hers soon if the NFS folks don't pipe up. It is one of the rare cases of still being open-coded, but the
strlen()usage was pre-existing to check for the trailing comma, so it's not a cleanseq_buf()conversion candidate...--
Kees Cook
PATCH 22/28 media: si2165: Use snprintf() to format frontend name
In reply to Bill Wendlingsi2165_probe() constructs the frontend name by appending the chip name and supported delivery system suffixes (" DVB-T", " DVB-C") to state->fe.ops.info.name using multiple strlcat() calls.
In preparation for removing the deprecated strlcat() API[1], format the complete frontend name in a single snprintf() call.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/media/dvb-frontends/si2165.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/media/dvb-frontends/si2165.c +7 -10
@@ -1243,20 +1243,17 @@ static int si2165_probe(struct i2c_client *client) chip_name, rev_char, state->chip_type, state->chip_revcode); -strlcat (state->fe.ops.info.name, chip_name, -sizeof (state->fe.ops.info.name)); +snprintf (state->fe.ops.info.name,sizeof (state->fe.ops.info.name), +"Silicon Labs %s%s%s" , + chip_name, + state->has_dvbt ?" DVB-T" :"" , + state->has_dvbc ?" DVB-C" :"" ); n =0 ; -if (state->has_dvbt) { +if (state->has_dvbt) state->fe.ops.delsys[n++] =SYS_DVBT ; -strlcat (state->fe.ops.info.name," DVB-T" , -sizeof (state->fe.ops.info.name)); - } -if (state->has_dvbc) { +if (state->has_dvbc) state->fe.ops.delsys[n++] =SYS_DVBC_ANNEX_A ; -strlcat (state->fe.ops.info.name," DVB-C" , -sizeof (state->fe.ops.info.name)); - }/* return fe pointer */ *pdata->fe = &state->fe;
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
RE: [PATCH 22/28] media: si2165: Use snprintf() to format frontend name
Quoted 237 lines
-----Original Message-----
From: Bill Wendling <[email protected]>
Sent: Tuesday, September 15, 2026 10:19 AM
To: [email protected]
Cc: Bill Wendling <[email protected]>; codemender- [email protected]; Russell King <[email protected]>; Huacai Chen <[email protected]>; WANG Xuerui <[email protected]>; Thomas Bogendoerfer <[email protected]>; James E.J. Bottomley <[email protected]>; Helge Deller <[email protected]>; Thomas Gleixner <[email protected]>; Ingo Molnar <[email protected]>; Borislav Petkov <[email protected]>; Dave Hansen <[email protected]>; [email protected]; H. Peter Anvin <[email protected]>; Ian Abbott <[email protected]>; H Hartley Sweeten <[email protected]>; Luck, Tony <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; David Airlie <[email protected]>; Simona Vetter <[email protected]>; Brost, Matthew <[email protected]>; Thomas Hellström <[email protected]>; Vivi, Rodrigo <[email protected]>; Dmitry Torokhov <[email protected]>; Matthias Schwarzott <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Arend van Spriel <[email protected]>; Rob Herring <[email protected]>; Saravana Kannan <[email protected]>; Krzysztof Kozlowski <[email protected]>; Sylwester Nawrocki <[email protected]>; Peter Griffin <[email protected]>; Alim Akhtar <[email protected]>; Linus Walleij <[email protected]>; Anil Gurumurthy <[email protected]>; Sudarsana Kalluru <[email protected]>; Martin K. Petersen <[email protected]>; Trond Myklebust <[email protected]>; Anna Schumaker <[email protected]>; Mike Marshall <[email protected]>; Martin Brandenburg <[email protected]>; Kees Cook <[email protected]>; Jiri Pirko <[email protected]>; Simon Horman <[email protected]>; Chuck Lever <[email protected]>; Jeff Layton <[email protected]>; NeilBrown <[email protected]>; Olga Kornievskaia <[email protected]>; Dai Ngo <[email protected]>; Tom Talpey <[email protected]>; Jaroslav Kysela <[email protected]>; Takashi Iwai <[email protected]>; Andrew Morton <[email protected]>; Mike Rapoport (Microsoft) <[email protected]>; Kanglong Wang <[email protected]>; Tiezhu Yang <[email protected]>; Qiang Ma <[email protected]>; Randy Dunlap <[email protected]>; Pengpeng Hou <[email protected]>; Ard Biesheuvel <[email protected]>; Breno Leitao <[email protected]>; Thorsten Blum <[email protected]>; Harshit Mogalapalli <[email protected]>; Greg Kroah-Hartman <[email protected]>; Lyude Paul <[email protected]>; Ashutosh Desai <[email protected]>; Deak, Imre <[email protected]>; Dmitry Baryshkov <[email protected]>; Johan Hovold <[email protected]>; Berg, Johannes <[email protected]>; Korenblit, Miriam Rachel <[email protected]>; Alexander Stein <[email protected]>; Cryolitia PukNgae <[email protected]>; Jiaming Zhang <[email protected]>; Will Porter <[email protected]>; Cen Zhang <[email protected]>; Cássio Gabriel <[email protected]>; Rong Zhang <[email protected]>; Arun Raghavan <[email protected]>; linux-arm- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; intel- [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH 22/28] media: si2165: Usesnprintf()to format frontend name
si2165_probe()constructs the frontend name by appending the chip name and supported delivery system suffixes (" DVB-T", " DVB-C") tostate->fe.ops.info.nameusing multiplestrlcat()calls.In preparation for removing the deprecated
strlcat()API[1], format the complete frontend name in a singlesnprintf()call.Assisted-by Developer:Gemini [editor_update_file,
make_kernel_build_single_file,shell_command_run]Signed-off-by Bill Wendling <[email protected]>---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- drivers/media/dvb-frontends/si2165.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)drivers/media/dvb- renamed from drivers/media/dvb-frontends/si2165.c +0
-0
frontends/si2165.c
indexf1241b63aa5c..bd15eb58fc84100644drivers/media/dvb-frontends/si2165.c +7
-10@@ -1243,20 +1243,17 @@ static int si2165_probe(struct i2c_client *client) chip_name, rev_char, state->chip_type, state->chip_revcode); -strlcat (state->fe.ops.info.name, chip_name, -sizeof (state->fe.ops.info.name)); +snprintf (state->fe.ops.info.name,sizeof (state- >fe.ops.info.name), +"Silicon Labs %s%s%s" , + chip_name, + state->has_dvbt ?" DVB-T" :"" , + state->has_dvbc ?" DVB-C" :"" ); n =0 ; -if (state->has_dvbt) { +if (state->has_dvbt) state->fe.ops.delsys[n++] =SYS_DVBT ; -strlcat (state->fe.ops.info.name," DVB-T" , -sizeof (state->fe.ops.info.name)); - } -if (state->has_dvbc) { +if (state->has_dvbc) state->fe.ops.delsys[n++] =SYS_DVBC_ANNEX_A ; -strlcat (state->fe.ops.info.name," DVB-C" , -sizeof (state->fe.ops.info.name)); - }drivers/media/dvb-frontends/si2165.c +0
-1/* return fe pointer */ *pdata->fe = &state->fe; --
Quoted 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 23/28 Input: synaptics_usb - use seq_buf and snprintf() for name and phys
In reply to Bill Wendlingsynusb_probe() constructs the device name and physical path using a mix of strscpy(), strlcat(), and snprintf().
In preparation for removing the deprecated strlcat() API[1], use struct seq_buf to incrementally build synusb->name, and format synusb->phys with snprintf() after generating the USB path.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/input/mouse/synaptics_usb.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-)
drivers/input/mouse/synaptics_usb.c +17 -12
@@ -41,6 +41,7 @@#include <linux/usb.h> #include <linux/input.h> #include <linux/usb/input.h> +#include <linux/seq_buf.h> #define USB_VENDOR_ID_SYNAPTICS 0x06cb#define USB_DEVICE_ID_SYNAPTICS_TP 0x0001/* Synaptics USB TouchPad */
@@ -278,6 +279,8 @@ static int synusb_probe(struct usb_interface *intf,struct input_dev *input_dev;unsigned int intf_num = intf->cur_altsetting->desc.bInterfaceNumber;unsigned int altsetting =min (intf->num_altsetting,1U ); +struct seq_buf s; +char path[64 ];int error; error =usb_set_interface (udev, intf_num, altsetting);
@@ -334,27 +337,29 @@ static int synusb_probe(struct usb_interface *intf, ep->bInterval); synusb->urb->transfer_flags |=URB_NO_TRANSFER_DMA_MAP ; +seq_buf_init (&s, synusb->name,sizeof (synusb->name)); +if (udev->manufacturer) -strscpy (synusb->name, udev->manufacturer, -sizeof (synusb->name)); +seq_buf_puts (&s, udev->manufacturer);if (udev->product) {if (udev->manufacturer) -strlcat (synusb->name," " ,sizeof (synusb->name)); -strlcat (synusb->name, udev->product,sizeof (synusb->name)); +seq_buf_puts (&s," " ); +seq_buf_puts (&s, udev->product); } -if (!strlen (synusb->name)) -snprintf (synusb->name,sizeof (synusb->name), -"USB Synaptics Device %04x:%04x" , -le16_to_cpu (udev->descriptor.idVendor), -le16_to_cpu (udev->descriptor.idProduct)); +if (!seq_buf_used (&s)) +seq_buf_printf (&s,"USB Synaptics Device %04x:%04x" , +le16_to_cpu (udev->descriptor.idVendor), +le16_to_cpu (udev->descriptor.idProduct));if (synusb->flags &SYNUSB_STICK ) -strlcat (synusb->name," (Stick)" ,sizeof (synusb->name)); +seq_buf_puts (&s," (Stick)" ); -usb_make_path (udev, synusb->phys,sizeof (synusb->phys)); -strlcat (synusb->phys,"/input0" ,sizeof (synusb->phys)); +seq_buf_str (&s); + +usb_make_path (udev, path,sizeof (path)); +snprintf (synusb->phys,sizeof (synusb->phys),"%s/input0" , path); input_dev->name = synusb->name; input_dev->phys = synusb->phys;
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 24/28 EDAC/thunderx: Fix stale error context in thunderx_l2c_threaded_isr()
In reply to Bill Wendlingthunderx_l2c_threaded_isr() computes "tail" and "ctx" once before entering the loop that drains the L2C error ring, and never updates them on subsequent iterations. When multiple errors are queued, every iteration reports the first ring entry rather than advancing through the ring, causing subsequent hardware errors in a batch to go unreported.
Recompute "tail" and "ctx" at the start of each loop iteration, matching the sibling thunderx_ocx_com_threaded_isr() and thunderx_ocx_lnk_threaded_isr() handlers.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/edac/thunderx_edac.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/edac/thunderx_edac.c +3 -0
@@ -1880,6 +1880,9 @@ static irqreturn_t thunderx_l2c_threaded_isr(int irq, void *irq_id)while (CIRC_CNT (l2c->ring_head, l2c->ring_tail,ARRAY_SIZE (l2c->err_ctx))) { + tail =ring_pos (l2c->ring_tail,ARRAY_SIZE (l2c->err_ctx)); + ctx = &l2c->err_ctx[tail]; + snprintf(msg, L2C_MESSAGE_SIZE, "%s: %s: %016llx, %s: %016llx", l2c->edac_dev->ctl_name, reg_int_name, ctx->reg_int,
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
RE: [PATCH 24/28] EDAC/thunderx: Fix stale error context in thunderx_l2c_threaded_isr()
Quoted 220 lines
-----Original Message-----
From: Bill Wendling <[email protected]>
Sent: Tuesday, September 15, 2026 10:19 AM
To: [email protected]
Cc: Bill Wendling <[email protected]>; Russell King <[email protected]>; Huacai Chen <[email protected]>; WANG Xuerui <[email protected]>; Thomas Bogendoerfer <[email protected]>; James E.J. Bottomley <[email protected]>; Helge Deller <[email protected]>; Thomas Gleixner <[email protected]>; Ingo Molnar <[email protected]>; Borislav Petkov <[email protected]>; Dave Hansen <[email protected]>; [email protected]; H. Peter Anvin <[email protected]>; Ian Abbott <[email protected]>; H Hartley Sweeten <[email protected]>; Luck, Tony <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; David Airlie <[email protected]>; Simona Vetter <[email protected]>; Brost, Matthew <[email protected]>; Thomas Hellström <[email protected]>; Vivi, Rodrigo <[email protected]>; Dmitry Torokhov <[email protected]>; Matthias Schwarzott <[email protected]>; Mauro Carvalho Chehab <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Arend van Spriel <[email protected]>; Rob Herring <[email protected]>; Saravana Kannan <[email protected]>; Krzysztof Kozlowski <[email protected]>; Sylwester Nawrocki <[email protected]>; Peter Griffin <[email protected]>; Alim Akhtar <[email protected]>; Linus Walleij <[email protected]>; Anil Gurumurthy <[email protected]>; Sudarsana Kalluru <[email protected]>; Martin K. Petersen <[email protected]>; Trond Myklebust <[email protected]>; Anna Schumaker <[email protected]>; Mike Marshall <[email protected]>; Martin Brandenburg <[email protected]>; Kees Cook <[email protected]>; Jiri Pirko <[email protected]>; Simon Horman <[email protected]>; Chuck Lever <[email protected]>; Jeff Layton <[email protected]>; NeilBrown <[email protected]>; Olga Kornievskaia <[email protected]>; Dai Ngo <[email protected]>; Tom Talpey <[email protected]>; Jaroslav Kysela <[email protected]>; Takashi Iwai <[email protected]>; Andrew Morton <[email protected]>; Mike Rapoport (Microsoft) <[email protected]>; Kanglong Wang <[email protected]>; Tiezhu Yang <[email protected]>; Qiang Ma <[email protected]>; Randy Dunlap <[email protected]>; Pengpeng Hou <[email protected]>; Ard Biesheuvel <[email protected]>; Breno Leitao <[email protected]>; Thorsten Blum <[email protected]>; Harshit Mogalapalli <[email protected]>; Greg Kroah-Hartman <[email protected]>; Lyude Paul <[email protected]>; Ashutosh Desai <[email protected]>; Deak, Imre <[email protected]>; Dmitry Baryshkov <[email protected]>; Johan Hovold <[email protected]>; Berg, Johannes <[email protected]>; Korenblit, Miriam Rachel <[email protected]>; Alexander Stein <[email protected]>; Cryolitia PukNgae <[email protected]>; Jiaming Zhang <[email protected]>; Will Porter <[email protected]>; Cen Zhang <[email protected]>; Cássio Gabriel <[email protected]>; Rong Zhang <[email protected]>; Arun Raghavan <[email protected]>; linux-arm- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; intel- [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH 24/28] EDAC/thunderx: Fix stale error context inthunderx_l2c_threaded_isr()
thunderx_l2c_threaded_isr()computes "tail" and "ctx" once before entering the loop that drains the L2C error ring, and never updates them on subsequent iterations. When multiple errors are queued, every iteration reports the first ring entry rather than advancing through the ring, causing subsequent hardware errors in a batch to go unreported.Recompute "tail" and "ctx" at the start of each loop iteration, matching the sibling
thunderx_ocx_com_threaded_isr()andthunderx_ocx_lnk_threaded_isr()handlers.Fixes 41003396f932 ("EDAC, thunderx: Add Cavium ThunderX EDACdriver")
Signed-off-by Bill Wendling <[email protected]>---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- drivers/edac/thunderx_edac.c | 3 +++ 1 file changed, 3 insertions(+)(quoted diff) +0
-0
b/drivers/edac/thunderx_edac.cindex9c0a1e48f96f..e7c335ca0c36100644drivers/edac/thunderx_edac.c +3
-0@@ -1880,6 +1880,9 @@ static irqreturn_t thunderx_l2c_threaded_isr(int irq, void *irq_id)while (CIRC_CNT (l2c->ring_head, l2c->ring_tail,ARRAY_SIZE (l2c->err_ctx))) { + tail =ring_pos (l2c->ring_tail,ARRAY_SIZE (l2c- >err_ctx)); + ctx = &l2c->err_ctx[tail]; + snprintf(msg, L2C_MESSAGE_SIZE,drivers/edac/thunderx_edac.c +0
-0"%s: %s: %016llx, %s: %016llx" , l2c->edac_dev->ctl_name, reg_int_name, ctx-Quoted 1 line
reg_int,
Quoted 2 lines
--
2.55.0.1032.g73a4cd73de-goog
PATCH 25/28 EDAC/thunderx: Replace strlcat() with seq_buf
In reply to Bill WendlingThe threaded ISR handlers (thunderx_ocx_com_threaded_isr(), thunderx_ocx_lnk_threaded_isr(), and thunderx_l2c_threaded_isr()) build multi-line error reports by formatting register details into a scratch buffer and appending them to "msg" with strlcat().
In preparation for removing the deprecated strlcat() API[1], refactor the ISR handlers to construct error messages using struct seq_buf.
Additionally, fix two bugs in decode_register(): initialize "str[0] = '\0'" so callers do not append stale buffer contents when no error bits match, and stop iterating if snprintf() truncates the buffer to avoid underflowing the remaining "size" counter.
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/edac/thunderx_edac.c | 64 ++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 25 deletions(-)
drivers/edac/thunderx_edac.c +39 -25
@@ -20,6 +20,7 @@#include <linux/atomic.h> #include <linux/bitfield.h> #include <linux/circ_buf.h> +#include <linux/seq_buf.h> #include <asm/page.h>
@@ -47,12 +48,17 @@ static void decode_register(char *str, size_t size, {int ret =0 ; +if (size >0 ) + str[0 ] ='\0' ; +while (descr->type && descr->mask && descr->descr) {if (reg & descr->mask) { ret =snprintf (str, size,"\n\t%s, %s" , descr->type ==ERR_CORRECTED ?"Corrected" :"Uncorrected" , descr->descr); +if (ret <0 || ret >= size) +break ; str += ret; size -= ret; }
@@ -1115,35 +1121,37 @@ static irqreturn_t thunderx_ocx_com_threaded_isr(int irq, void *irq_id)while (CIRC_CNT (ocx->com_ring_head, ocx->com_ring_tail,ARRAY_SIZE (ocx->com_err_ctx))) { +struct seq_buf s; + tail =ring_pos (ocx->com_ring_tail,ARRAY_SIZE (ocx->com_err_ctx)); ctx = &ocx->com_err_ctx[tail]; -snprintf (msg,OCX_MESSAGE_SIZE ,"%s: OCX_COM_INT: %016llx" , - ocx->edac_dev->ctl_name, ctx->reg_com_int); +seq_buf_init (&s, msg,OCX_MESSAGE_SIZE ); + +seq_buf_printf (&s,"%s: OCX_COM_INT: %016llx" , + ocx->edac_dev->ctl_name, ctx->reg_com_int);decode_register (other,OCX_OTHER_SIZE , ocx_com_errors, ctx->reg_com_int); -strlcat (msg, other,OCX_MESSAGE_SIZE ); +seq_buf_puts (&s, other);for (lane =0 ; lane <OCX_RX_LANES ; lane++)if (ctx->reg_com_int &BIT (lane)) { -snprintf (other,OCX_OTHER_SIZE , -"\n\tOCX_LNE_INT[%02d]: %016llx OCX_LNE_STAT11[%02d]: %016llx" , - lane, ctx->reg_lane_int[lane], - lane, ctx->reg_lane_stat11[lane]); - -strlcat (msg, other,OCX_MESSAGE_SIZE ); +seq_buf_printf (&s, +"\n\tOCX_LNE_INT[%02d]: %016llx OCX_LNE_STAT11[%02d]: %016llx" , + lane, ctx->reg_lane_int[lane], + lane, ctx->reg_lane_stat11[lane]);decode_register (other,OCX_OTHER_SIZE , ocx_lane_errors, ctx->reg_lane_int[lane]); -strlcat (msg, other,OCX_MESSAGE_SIZE ); +seq_buf_puts (&s, other); }if (ctx->reg_com_int &OCX_COM_INT_CE ) -edac_device_handle_ce (ocx->edac_dev,0 ,0 , msg); +edac_device_handle_ce (ocx->edac_dev,0 ,0 ,seq_buf_str (&s)); ocx->com_ring_tail++; }
@@ -1196,25 +1204,28 @@ static irqreturn_t thunderx_ocx_lnk_threaded_isr(int irq, void *irq_id)while (CIRC_CNT (ocx->link_ring_head, ocx->link_ring_tail,ARRAY_SIZE (ocx->link_err_ctx))) { +struct seq_buf s; + tail =ring_pos (ocx->link_ring_head,ARRAY_SIZE (ocx->link_err_ctx)); ctx = &ocx->link_err_ctx[tail]; -snprintf (msg,OCX_MESSAGE_SIZE , -"%s: OCX_COM_LINK_INT[%d]: %016llx" , - ocx->edac_dev->ctl_name, - ctx->link, ctx->reg_com_link_int); +seq_buf_init (&s, msg,OCX_MESSAGE_SIZE ); + +seq_buf_printf (&s,"%s: OCX_COM_LINK_INT[%d]: %016llx" , + ocx->edac_dev->ctl_name, + ctx->link, ctx->reg_com_link_int);decode_register (other,OCX_OTHER_SIZE , ocx_com_link_errors, ctx->reg_com_link_int); -strlcat (msg, other,OCX_MESSAGE_SIZE ); +seq_buf_puts (&s, other);if (ctx->reg_com_link_int &OCX_COM_LINK_INT_UE ) -edac_device_handle_ue (ocx->edac_dev,0 ,0 , msg); +edac_device_handle_ue (ocx->edac_dev,0 ,0 ,seq_buf_str (&s));else if (ctx->reg_com_link_int &OCX_COM_LINK_INT_CE ) -edac_device_handle_ce (ocx->edac_dev,0 ,0 , msg); +edac_device_handle_ce (ocx->edac_dev,0 ,0 ,seq_buf_str (&s)); ocx->link_ring_tail++; }
@@ -1880,22 +1891,25 @@ static irqreturn_t thunderx_l2c_threaded_isr(int irq, void *irq_id)while (CIRC_CNT (l2c->ring_head, l2c->ring_tail,ARRAY_SIZE (l2c->err_ctx))) { +struct seq_buf s; + tail =ring_pos (l2c->ring_tail,ARRAY_SIZE (l2c->err_ctx)); ctx = &l2c->err_ctx[tail]; -snprintf (msg,L2C_MESSAGE_SIZE , -"%s: %s: %016llx, %s: %016llx" , - l2c->edac_dev->ctl_name, reg_int_name, ctx->reg_int, - ctx->reg_ext_name, ctx->reg_ext); +seq_buf_init (&s, msg,L2C_MESSAGE_SIZE ); + +seq_buf_printf (&s,"%s: %s: %016llx, %s: %016llx" , + l2c->edac_dev->ctl_name, reg_int_name, ctx->reg_int, + ctx->reg_ext_name, ctx->reg_ext);decode_register (other,L2C_OTHER_SIZE , l2_errors, ctx->reg_int); -strlcat (msg, other,L2C_MESSAGE_SIZE ); +seq_buf_puts (&s, other);if (ctx->reg_int & mask_ue) -edac_device_handle_ue (l2c->edac_dev,0 ,0 , msg); +edac_device_handle_ue (l2c->edac_dev,0 ,0 ,seq_buf_str (&s));else if (ctx->reg_int & mask_ce) -edac_device_handle_ce (l2c->edac_dev,0 ,0 , msg); +edac_device_handle_ce (l2c->edac_dev,0 ,0 ,seq_buf_str (&s)); l2c->ring_tail++; }
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Kees Cook
maintainerRe: [PATCH 25/28] EDAC/thunderx: Replace strlcat() with seq_buf
Quoted 19 lines · Bill Wendling
index
e7c335ca0c36..4e3781815b6d100644drivers/edac/thunderx_edac.c +4
-0@@ -20,6 +20,7 @@#include <linux/atomic.h> #include <linux/bitfield.h> #include <linux/circ_buf.h> +#include <linux/seq_buf.h> #include <asm/page.h> @@ -47,12 +48,17 @@ static void decode_register(char *str, size_t size, {int ret =0 ; +if (size >0 ) + str[0 ] ='\0' ; +while (descr->type && descr->mask && descr->descr) {
drivers/edac/thunderx_edac.c static void decode_register(char *str, size_t size, · line 64
Quoted 10 lines
drivers/edac/thunderx_edac.c +2
-0if (reg & descr->mask) { ret =snprintf (str, size,"\n\t%s, %s" , descr->type ==ERR_CORRECTED ?"Corrected" :"Uncorrected" , descr->descr); +if (ret <0 || ret >= size) +break ; str += ret; size -= ret; }
Seems like seq_buf would be better her? But yes, at the very least, this needs to be scnprintf, not snprintf (or add the checks as you have here).
The rest of the seq_buf conversions look right.
Signature · 1 line
Kees Cook
Borislav Petkov
maintainerRe: [PATCH 25/28] EDAC/thunderx: Replace strlcat() with seq_buf
Quoted 5 lines · Kees Cook
Seems like
seq_bufwould be better her? But yes, at the very least, this needs to be scnprintf, not snprintf (or add the checks as you have here).The rest of the
seq_bufconversions look right.
This driver has been an orphan for a while now (we just made it official) so I'd prefer it if we don't do anything here.
And yes, that mega CC list is just gross.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteRe: [PATCH 25/28] EDAC/thunderx: Replace strlcat() with seq_buf
Quoted 11 lines · Borislav Petkov
Quoted 5 lines · Kees Cook
Seems like
seq_bufwould be better her? But yes, at the very least, this needs to be scnprintf, not snprintf (or add the checks as you have here).The rest of the
seq_bufconversions look right.This driver has been an orphan for a while now (we just made it official) so I'd prefer it if we don't do anything here.
I'll remove those changes from future emails.
Quoted 2 lines
And yes, that mega CC list is just gross.
Apologies. :-(
-bw
PATCH 26/28 wifi: wil6210: Refactor resume_triggers2string() to use seq_buf
In reply to Bill Wendlingresume_triggers2string() builds a space-separated string of active resume trigger names using a series of conditional strlcat() calls.
In preparation for removing the deprecated strlcat() API[1], replace the strlcat() calls with struct seq_buf and seq_buf_puts().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/net/wireless/ath/wil6210/wmi.c | 38 ++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-)
drivers/net/wireless/ath/wil6210/wmi.c +21 -17
@@ -7,6 +7,7 @@#include <linux/moduleparam.h> #include <linux/etherdevice.h> #include <linux/if_arp.h> +#include <linux/seq_buf.h> #include "wil6210.h" #include "txrx.h"
@@ -3162,27 +3163,30 @@ int wmi_suspend(struct wil6210_priv *wil)static void resume_triggers2string (u32 triggers,char *string,int str_size) { - string[0 ] ='\0' ; +struct seq_buf s; + +seq_buf_init (&s, string, str_size);if (!triggers) { -strlcat (string," UNKNOWN" , str_size); -return ; +seq_buf_puts (&s," UNKNOWN" ); + }else { +if (triggers &WMI_RESUME_TRIGGER_HOST ) +seq_buf_puts (&s," HOST" ); + +if (triggers &WMI_RESUME_TRIGGER_UCAST_RX ) +seq_buf_puts (&s," UCAST_RX" ); + +if (triggers &WMI_RESUME_TRIGGER_BCAST_RX ) +seq_buf_puts (&s," BCAST_RX" ); + +if (triggers &WMI_RESUME_TRIGGER_WMI_EVT ) +seq_buf_puts (&s," WMI_EVT" ); + +if (triggers &WMI_RESUME_TRIGGER_DISCONNECT ) +seq_buf_puts (&s," DISCONNECT" ); } -if (triggers &WMI_RESUME_TRIGGER_HOST ) -strlcat (string," HOST" , str_size); - -if (triggers &WMI_RESUME_TRIGGER_UCAST_RX ) -strlcat (string," UCAST_RX" , str_size); - -if (triggers &WMI_RESUME_TRIGGER_BCAST_RX ) -strlcat (string," BCAST_RX" , str_size); - -if (triggers &WMI_RESUME_TRIGGER_WMI_EVT ) -strlcat (string," WMI_EVT" , str_size); - -if (triggers &WMI_RESUME_TRIGGER_DISCONNECT ) -strlcat (string," DISCONNECT" , str_size); +seq_buf_str (&s); }int wmi_resume (struct wil6210_priv *wil)
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
PATCH 27/28 drm/xe/pf: Convert strlcat() to seq_buf in control_read()
In reply to Bill Wendlingcontrol_read() builds a list of supported SR-IOV VF control commands in a stack buffer by calling strlcat() twice per command in a loop.
In preparation for removing the deprecated strlcat() API[1], use struct seq_buf and seq_buf_printf() to format each command line and pass seq_buf_used() directly to simple_read_from_buffer().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +5 -4
@@ -4,6 +4,7 @@*/ #include <linux/debugfs.h> +#include <linux/seq_buf.h> #include <drm/drm_print.h> #include <drm/drm_debugfs.h>
@@ -663,15 +664,15 @@ static ssize_t control_write(struct file *file, const char __user *buf, size_t cstatic ssize_t control_read (struct file *file,char __user *buf,size_t count,loff_t *ppos) {char help[128 ]; +struct seq_buf s;size_t n; - help[0 ] ='\0' ; +seq_buf_init (&s, help,sizeof (help));for (n =0 ; n <ARRAY_SIZE (control_cmds); n++) { -strlcat (help, control_cmds[n].cmd,sizeof (help)); -strlcat (help,"\n" ,sizeof (help)); +seq_buf_printf (&s,"%s\n" , control_cmds[n].cmd); } -return simple_read_from_buffer (buf, count, ppos, help,strlen (help)); +return simple_read_from_buffer (buf, count, ppos, help,seq_buf_used (&s)); }static const struct file_operations control_ops = {
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Kees Cook
maintainerRe: [PATCH 27/28] drm/xe/pf: Convert strlcat() to seq_buf in control_read()
Quoted 16 lines · Bill Wendling
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +1
-0@@ -4,6 +4,7 @@*/ #include <linux/debugfs.h> +#include <linux/seq_buf.h> #include <drm/drm_print.h> #include <drm/drm_debugfs.h> @@ -663,15 +664,15 @@ static ssize_t control_write(struct file *file, const char __user *buf, size_t cstatic ssize_t control_read (struct file *file,char __user *buf,size_t count,loff_t *ppos) {char help[128 ];
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c static ssize_t control_write(struct file *file, const char __user *buf, size_t c · line 673
Quoted 10 lines
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +3
-3+struct seq_buf s;size_t n; - help[0 ] ='\0' ; +seq_buf_init (&s, help,sizeof (help));for (n =0 ; n <ARRAY_SIZE (control_cmds); n++) { -strlcat (help, control_cmds[n].cmd,sizeof (help)); -strlcat (help,"\n" ,sizeof (help)); +seq_buf_printf (&s,"%s\n" , control_cmds[n].cmd); }
Yay seq_buf! I would tweak the 3 init stack variable lines into just using the single DECLARE_SEQ_BUF:
DECLARE_SEQ_BUF(s, 128);
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c static ssize_t control_write(struct file *file, const char __user *buf, size_t c · line 675
Quoted 3 lines
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +1
-1-return simple_read_from_buffer (buf, count, ppos, help,strlen (help)); +return simple_read_from_buffer (buf, count, ppos, help,seq_buf_used (&s));
seq_buf_used() isn't correct in the case of full-buffer use. e.g. if the help buffer ends up filled with 127 chars and a NUL terminator, seq_buf_used() returns 128, but you want 127 here. Using strlen() ends up being redundant, though. I think we need to add seq_buf_strlen() which handles the same logic that seq_buf_str() does.
-Kees
Signature · 1 line
Kees Cook
PATCH 28/28 drm/xe/pf: Refactor strlcat() to seq_buf in sched_group_engines_read()
In reply to Bill WendlingSimilar to control_read(), sched_group_engines_read() constructs a space-separated list of hardware engine names in a stack buffer using repeated strlcat() calls inside a loop.
In preparation for removing the deprecated strlcat() API[1], refactor sched_group_engines_read() to use struct seq_buf and seq_buf_printf().
---
Cc: Russell King <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Matthias Schwarzott <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Saravana Kannan <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Anil Gurumurthy <[email protected]>
Cc: Sudarsana Kalluru <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Chuck Lever <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: NeilBrown <[email protected]>
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Bill Wendling <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "Mike Rapoport (Microsoft)" <[email protected]>
Cc: Kanglong Wang <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Cc: Qiang Ma <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Pengpeng Hou <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Breno Leitao <[email protected]>
Cc: Thorsten Blum <[email protected]>
Cc: Harshit Mogalapalli <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Ashutosh Desai <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Cryolitia PukNgae <[email protected]>
Cc: Jiaming Zhang <[email protected]>
Cc: Will Porter <[email protected]>
Cc: Cen Zhang <[email protected]>
Cc: "Cássio Gabriel" <[email protected]>
Cc: Rong Zhang <[email protected]>
Cc: Arun Raghavan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +8 -7
@@ -377,8 +377,10 @@ static ssize_t sched_group_engines_read(struct file *file, char __user *buf,struct xe_hw_engine *hwe;enum xe_hw_engine_id id;char engines[128 ]; +struct seq_buf s; +const char *s_str; - engines[0 ] ='\0' ; +seq_buf_init (&s, engines,sizeof (engines));if (group < num_groups) {for_each_hw_engine (hwe, gt, id) {
@@ -386,15 +388,14 @@ static ssize_t sched_group_engines_read(struct file *file, char __user *buf,u16 guc_logical_instance =xe_hwe_guc_logical_instance (hwe);u32 mask = groups[group].engines[guc_class]; -if (mask &BIT (guc_logical_instance)) { -strlcat (engines, hwe->name,sizeof (engines)); -strlcat (engines," " ,sizeof (engines)); - } +if (mask &BIT (guc_logical_instance)) +seq_buf_printf (&s,"%s " , hwe->name); } -strlcat (engines,"\n" ,sizeof (engines)); +seq_buf_puts (&s,"\n" ); } -return simple_read_from_buffer (buf, count, ppos, engines,strlen (engines)); + s_str =seq_buf_str (&s); +return simple_read_from_buffer (buf, count, ppos, s_str,strlen (s_str)); }static const struct file_operations sched_group_engines_fops = {
Signature · 1 line
2.55.0.1032.g73a4cd73de-goog
Kees Cook
maintainerRe: [PATCH 28/28] drm/xe/pf: Refactor strlcat() to seq_buf in sched_group_engines_read()
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c
Quoted 1 line · Bill Wendling
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +0
-0
This is the same file touched as
https://lore.kernel.org/all/[email protected]/
and doing the same thing, roughly? I think it'd be best to combine these, especially since one depends on the other's addition of seq_buf.h
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c static ssize_t sched_group_engines_read(struct file *file, char __user *buf, · line 383
Quoted 12 lines
index
5db7fc067c4d..548a50f74422100644drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +3
-1@@ -377,8 +377,10 @@ static ssize_t sched_group_engines_read(struct file *file, char __user *buf,struct xe_hw_engine *hwe;enum xe_hw_engine_id id;char engines[128 ]; +struct seq_buf s; +const char *s_str; - engines[0 ] ='\0' ; +seq_buf_init (&s, engines,sizeof (engines));
As with the others, DECLARE_SEQ_BUF should be used.
Quoted 10 lines
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +0
-4if (group < num_groups) {for_each_hw_engine (hwe, gt, id) {@@ -386,15 +388,14 @@ static ssize_t sched_group_engines_read(struct file *file, char __user *buf,u16 guc_logical_instance =xe_hwe_guc_logical_instance (hwe);u32 mask = groups[group].engines[guc_class]; -if (mask &BIT (guc_logical_instance)) { -strlcat (engines, hwe->name,sizeof (engines)); -strlcat (engines," " ,sizeof (engines)); - }
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c static ssize_t sched_group_engines_read(struct file *file, char __user *buf, · line 398
Quoted 10 lines
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +5
-2+if (mask &BIT (guc_logical_instance)) +seq_buf_printf (&s,"%s " , hwe->name); } -strlcat (engines,"\n" ,sizeof (engines)); +seq_buf_puts (&s,"\n" ); } -return simple_read_from_buffer (buf, count, ppos, engines,strlen (engines)); + s_str =seq_buf_str (&s); +return simple_read_from_buffer (buf, count, ppos, s_str,strlen (s_str));
While this is the correct length, it does illustrate why I think we need a new seq_buf helper to get the strlen result detected from NUL termination like seq_buf_str().
-Kees
Signature · 1 line
Kees Cook
Quoted 5 lines · Bill Wendling
strlcat()is deprecated: likestrcat(), 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.
... but what many of your patches do is to replace strlcat() with open-codes, which is more error-prone and easier to get wrong than a single strlcat() call.
Quoted 3 lines
See:
It's clear that strlcat() isn't perfect and sometimes inefficient. But blindly deprecating without providing a good alternative doesn't sound like a right approach to me.
thanks,
Takashi
Patchwork
CI✓ CI.KUnit: success for Replace remaining strlcat() call sites with snprintf()/seq_buf()
In reply to Bill Wendling== Series Details ==
== Series Details ==
Series: Replace remaining strlcat() call sites with snprintf()/seq_buf()
URL : https://patchwork.freedesktop.org/series/174150/
State : success
== Summary ==
+ trap cleanup EXIT
+ kunitconfigs=('/kernel/drivers/gpu/tests/.kunitconfig' '/kernel/drivers/gpu/drm/xe/.kunitconfig' '/kernel/drivers/gpu/drm/tests/.kunitconfig' '/kernel/drivers/gpu/drm/ttm/tests/.kunitconfig' '/kernel/drivers/dma-buf/.kunitconfig')
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/tests/.kunitconfig
[14:21:04] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [14:21:08] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [14:21:28] Starting KUnit Kernel (1/1)... [14:21:28] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [14:21:28] ============= refcount_interrupt (4 subtests) ============== [14:21:28] [PASSED] test_single_irq_change [14:21:28] [PASSED] test_nested_irq_change [14:21:28] [PASSED] test_multiple_irq_change [14:21:28] [PASSED] test_irq_save [14:21:28] =============== [PASSED] refcount_interrupt ================ [14:21:28] ================= gpu_buddy (14 subtests) ================== [14:21:28] [PASSED] gpu_test_buddy_alloc_limit [14:21:28] [PASSED] gpu_test_buddy_alloc_optimistic [14:21:28] [PASSED] gpu_test_buddy_alloc_pessimistic [14:21:28] [PASSED] gpu_test_buddy_alloc_pathological [14:21:28] [PASSED] gpu_test_buddy_alloc_contiguous [14:21:28] [PASSED] gpu_test_buddy_alloc_clear [14:21:28] [PASSED] gpu_test_buddy_alloc_range [14:21:29] [PASSED] gpu_test_buddy_alloc_range_bias [14:21:30] [PASSED] gpu_test_buddy_fragmentation_performance [14:21:30] [PASSED] gpu_test_buddy_dirty_tracker_performance [14:21:30] [PASSED] gpu_test_buddy_alloc_exceeds_max_order [14:21:30] [PASSED] gpu_test_buddy_offset_aligned_allocation [14:21:30] [PASSED] gpu_test_buddy_subtree_offset_alignment_stress [14:21:30] [PASSED] gpu_test_buddy_addr_to_block [14:21:30] ==================== [PASSED] gpu_buddy ==================== [14:21:30] ============================================================ [14:21:30] Testing complete. Ran 18 tests: passed: 18 [14:21:30] Elapsed time: 26.710s total, 4.380s configuring, 20.412s building, 1.877s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/xe/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [14:21:30] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [14:21:32] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [14:22:06] Starting KUnit Kernel (1/1)... [14:22:06] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [14:22:06] ============= refcount_interrupt (4 subtests) ============== [14:22:06] [PASSED] test_single_irq_change [14:22:06] [PASSED] test_nested_irq_change [14:22:06] [PASSED] test_multiple_irq_change [14:22:06] [PASSED] test_irq_save [14:22:06] =============== [PASSED] refcount_interrupt ================ [14:22:06] ================== guc_buf (11 subtests) =================== [14:22:06] [PASSED] test_smallest [14:22:06] [PASSED] test_largest [14:22:06] [PASSED] test_granular [14:22:06] [PASSED] test_unique [14:22:06] [PASSED] test_overlap [14:22:06] [PASSED] test_reusable [14:22:06] [PASSED] test_too_big [14:22:06] [PASSED] test_flush [14:22:06] [PASSED] test_lookup [14:22:06] [PASSED] test_data [14:22:06] [PASSED] test_class [14:22:06] ===================== [PASSED] guc_buf ===================== [14:22:06] =================== guc_dbm (7 subtests) =================== [14:22:06] [PASSED] test_empty [14:22:06] [PASSED] test_default [14:22:06] ======================== test_size ======================== [14:22:06] [PASSED] 4 [14:22:06] [PASSED] 8 [14:22:06] [PASSED] 32 [14:22:06] [PASSED] 256 [14:22:06] ==================== [PASSED] test_size ==================== [14:22:06] ======================= test_reuse ======================== [14:22:06] [PASSED] 4 [14:22:06] [PASSED] 8 [14:22:06] [PASSED] 32 [14:22:06] [PASSED] 256 [14:22:06] =================== [PASSED] test_reuse ==================== [14:22:06] =================== test_range_overlap ==================== [14:22:06] [PASSED] 4 [14:22:06] [PASSED] 8 [14:22:06] [PASSED] 32 [14:22:06] [PASSED] 256 [14:22:06] =============== [PASSED] test_range_overlap ================ [14:22:06] =================== test_range_compact ==================== [14:22:06] [PASSED] 4 [14:22:06] [PASSED] 8 [14:22:06] [PASSED] 32 [14:22:06] [PASSED] 256 [14:22:06] =============== [PASSED] test_range_compact ================ [14:22:06] ==================== test_range_spare ===================== [14:22:06] [PASSED] 4 [14:22:06] [PASSED] 8 [14:22:06] [PASSED] 32 [14:22:06] [PASSED] 256 [14:22:06] ================ [PASSED] test_range_spare ================= [14:22:06] ===================== [PASSED] guc_dbm ===================== [14:22:06] =================== guc_idm (6 subtests) =================== [14:22:06] [PASSED] bad_init [14:22:06] [PASSED] no_init [14:22:06] [PASSED] init_fini [14:22:06] [PASSED] check_used [14:22:06] [PASSED] check_quota [14:22:06] [PASSED] check_all [14:22:06] ===================== [PASSED] guc_idm ===================== [14:22:06] =============== guc_klv_helpers (9 subtests) =============== [14:22:06] [PASSED] test_count [14:22:06] [PASSED] test_encode_u32 [14:22:06] [PASSED] test_encode_u64 [14:22:06] [PASSED] test_encode_string [14:22:06] [PASSED] test_encode_object_raw [14:22:06] [PASSED] test_encode_object_klv [14:22:06] [PASSED] test_encode_object_nested [14:22:06] [PASSED] test_encode_object_basic [14:22:06] [PASSED] test_print [14:22:06] ================= [PASSED] guc_klv_helpers ================= [14:22:06] =================== xe_log (4 subtests) ==================== [14:22:06] [PASSED] demo_cper [14:22:06] [PASSED] demo_dmesg [14:22:06] ======================= test_dmesg ======================== [14:22:06] [PASSED] test_fatal [14:22:06] [PASSED] test_fatal_tile [14:22:06] [PASSED] test_fatal_gt [14:22:06] [PASSED] test_fatal_comp [14:22:06] [PASSED] test_fatal_comp_tile [14:22:06] [PASSED] test_fatal_comp_gt [14:22:06] [PASSED] test_fatal_all [14:22:06] [PASSED] test_recoverable [14:22:06] [PASSED] test_recoverable_tile [14:22:06] [PASSED] test_recoverable_gt [14:22:06] [PASSED] test_recoverable_comp [14:22:06] [PASSED] test_recoverable_comp_tile [14:22:06] [PASSED] test_recoverable_comp_gt [14:22:06] [PASSED] test_recoverable_all [14:22:06] [PASSED] test_info [14:22:06] [PASSED] test_info_tile [14:22:06] [PASSED] test_info_gt [14:22:06] [PASSED] test_info_err [14:22:06] [PASSED] test_info_comp [14:22:06] [PASSED] test_info_comp_tile [14:22:06] [PASSED] test_info_comp_gt [14:22:06] [PASSED] test_info_all [14:22:06] [PASSED] test_hw_fatal [14:22:06] [PASSED] test_hw_recoverable [14:22:06] [PASSED] test_hw_corrected [14:22:06] [PASSED] test_hw_informational [14:22:06] =================== [PASSED] test_dmesg ==================== [14:22:06] ====================== test_invalid ======================= [14:22:06] [SKIPPED] no-component no-location no-warn (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] reserved location (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] unknown location (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] nonzero-device-id location (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] invalid-tile-id location (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] invalid-gt-id location (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] unknown component class (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] unknown system component (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] unknown hardware component (requires CONFIG_DRM_XE_DEBUG) [14:22:06] [SKIPPED] unknown component and location (requires CONFIG_DRM_XE_DEBUG) [14:22:06] ================== [SKIPPED] test_invalid ================== [14:22:06] ===================== [PASSED] xe_log ====================== [14:22:06] ================== no_relay (3 subtests) =================== [14:22:06] [PASSED] xe_drops_guc2pf_if_not_ready [14:22:06] [PASSED] xe_drops_guc2vf_if_not_ready [14:22:06] [PASSED] xe_rejects_send_if_not_ready [14:22:06] ==================== [PASSED] no_relay ===================== [14:22:06] ================== pf_relay (14 subtests) ================== [14:22:06] [PASSED] pf_rejects_guc2pf_too_short [14:22:06] [PASSED] pf_rejects_guc2pf_too_long [14:22:06] [PASSED] pf_rejects_guc2pf_no_payload [14:22:06] [PASSED] pf_fails_no_payload [14:22:06] [PASSED] pf_fails_bad_origin [14:22:06] [PASSED] pf_fails_bad_type [14:22:06] [PASSED] pf_txn_reports_error [14:22:06] [PASSED] pf_txn_sends_pf2guc [14:22:06] [PASSED] pf_sends_pf2guc [14:22:06] [SKIPPED] pf_loopback_nop (requires CONFIG_DRM_XE_DEBUG_SRIOV) [14:22:06] [SKIPPED] pf_loopback_echo (requires CONFIG_DRM_XE_DEBUG_SRIOV) [14:22:06] [SKIPPED] pf_loopback_fail (requires CONFIG_DRM_XE_DEBUG_SRIOV) [14:22:06] [SKIPPED] pf_loopback_busy (requires CONFIG_DRM_XE_DEBUG_SRIOV) [14:22:06] [SKIPPED] pf_loopback_retry (requires CONFIG_DRM_XE_DEBUG_SRIOV) [14:22:06] ==================== [PASSED] pf_relay ===================== [14:22:06] ================== vf_relay (3 subtests) =================== [14:22:06] [PASSED] vf_rejects_guc2vf_too_short [14:22:06] [PASSED] vf_rejects_guc2vf_too_long [14:22:06] [PASSED] vf_rejects_guc2vf_no_payload [14:22:06] ==================== [PASSED] vf_relay ===================== [14:22:06] ================ pf_gt_config (9 subtests) ================= [14:22:06] [PASSED] fair_contexts_1vf [14:22:06] [PASSED] fair_doorbells_1vf [14:22:06] [PASSED] fair_ggtt_1vf [14:22:06] ====================== fair_vram_1vf ====================== [14:22:06] [PASSED] 3.50 GiB [14:22:06] [PASSED] 11.5 GiB [14:22:06] [PASSED] 15.5 GiB [14:22:06] [PASSED] 31.5 GiB [14:22:06] [PASSED] 63.5 GiB [14:22:06] [PASSED] 1.91 GiB [14:22:06] ================== [PASSED] fair_vram_1vf ================== [14:22:06] ================ fair_vram_1vf_admin_only ================= [14:22:06] [PASSED] 3.50 GiB [14:22:06] [PASSED] 11.5 GiB [14:22:06] [PASSED] 15.5 GiB [14:22:06] [PASSED] 31.5 GiB [14:22:06] [PASSED] 63.5 GiB [14:22:06] [PASSED] 1.91 GiB [14:22:06] ============ [PASSED] fair_vram_1vf_admin_only ============= [14:22:06] ====================== fair_contexts ====================== [14:22:06] [PASSED] 1 VF [14:22:06] [PASSED] 2 VFs [14:22:06] [PASSED] 3 VFs [14:22:06] [PASSED] 4 VFs [14:22:06] [PASSED] 5 VFs [14:22:06] [PASSED] 6 VFs [14:22:06] [PASSED] 7 VFs [14:22:06] [PASSED] 8 VFs [14:22:06] [PASSED] 9 VFs [14:22:06] [PASSED] 10 VFs [14:22:06] [PASSED] 11 VFs [14:22:06] [PASSED] 12 VFs [14:22:06] [PASSED] 13 VFs [14:22:06] [PASSED] 14 VFs [14:22:06] [PASSED] 15 VFs [14:22:06] [PASSED] 16 VFs [14:22:06] [PASSED] 17 VFs [14:22:06] [PASSED] 18 VFs [14:22:06] [PASSED] 19 VFs [14:22:06] [PASSED] 20 VFs [14:22:06] [PASSED] 21 VFs [14:22:06] [PASSED] 22 VFs [14:22:06] [PASSED] 23 VFs [14:22:06] [PASSED] 24 VFs [14:22:06] [PASSED] 25 VFs [14:22:06] [PASSED] 26 VFs [14:22:06] [PASSED] 27 VFs [14:22:06] [PASSED] 28 VFs [14:22:06] [PASSED] 29 VFs [14:22:06] [PASSED] 30 VFs [14:22:06] [PASSED] 31 VFs [14:22:06] [PASSED] 32 VFs [14:22:06] [PASSED] 33 VFs [14:22:06] [PASSED] 34 VFs [14:22:06] [PASSED] 35 VFs [14:22:06] [PASSED] 36 VFs [14:22:06] [PASSED] 37 VFs [14:22:06] [PASSED] 38 VFs [14:22:06] [PASSED] 39 VFs [14:22:06] [PASSED] 40 VFs [14:22:06] [PASSED] 41 VFs [14:22:06] [PASSED] 42 VFs [14:22:06] [PASSED] 43 VFs [14:22:06] [PASSED] 44 VFs [14:22:06] [PASSED] 45 VFs [14:22:06] [PASSED] 46 VFs [14:22:06] [PASSED] 47 VFs [14:22:06] [PASSED] 48 VFs [14:22:06] [PASSED] 49 VFs [14:22:06] [PASSED] 50 VFs [14:22:06] [PASSED] 51 VFs [14:22:06] [PASSED] 52 VFs [14:22:06] [PASSED] 53 VFs [14:22:06] [PASSED] 54 VFs [14:22:06] [PASSED] 55 VFs [14:22:06] [PASSED] 56 VFs [14:22:06] [PASSED] 57 VFs [14:22:06] [PASSED] 58 VFs [14:22:06] [PASSED] 59 VFs [14:22:06] [PASSED] 60 VFs [14:22:06] [PASSED] 61 VFs [14:22:06] [PASSED] 62 VFs [14:22:06] [PASSED] 63 VFs [14:22:06] ================== [PASSED] fair_contexts ================== [14:22:06] ===================== fair_doorbells ====================== [14:22:06] [PASSED] 1 VF [14:22:06] [PASSED] 2 VFs [14:22:06] [PASSED] 3 VFs [14:22:06] [PASSED] 4 VFs [14:22:06] [PASSED] 5 VFs [14:22:06] [PASSED] 6 VFs [14:22:06] [PASSED] 7 VFs [14:22:06] [PASSED] 8 VFs [14:22:06] [PASSED] 9 VFs [14:22:06] [PASSED] 10 VFs [14:22:06] [PASSED] 11 VFs [14:22:06] [PASSED] 12 VFs [14:22:06] [PASSED] 13 VFs [14:22:06] [PASSED] 14 VFs [14:22:06] [PASSED] 15 VFs [14:22:06] [PASSED] 16 VFs [14:22:06] [PASSED] 17 VFs [14:22:06] [PASSED] 18 VFs [14:22:06] [PASSED] 19 VFs [14:22:06] [PASSED] 20 VFs [14:22:06] [PASSED] 21 VFs [14:22:06] [PASSED] 22 VFs [14:22:06] [PASSED] 23 VFs [14:22:06] [PASSED] 24 VFs [14:22:06] [PASSED] 25 VFs [14:22:06] [PASSED] 26 VFs [14:22:06] [PASSED] 27 VFs [14:22:06] [PASSED] 28 VFs [14:22:06] [PASSED] 29 VFs [14:22:06] [PASSED] 30 VFs [14:22:06] [PASSED] 31 VFs [14:22:06] [PASSED] 32 VFs [14:22:06] [PASSED] 33 VFs [14:22:06] [PASSED] 34 VFs [14:22:06] [PASSED] 35 VFs [14:22:06] [PASSED] 36 VFs [14:22:06] [PASSED] 37 VFs [14:22:06] [PASSED] 38 VFs [14:22:06] [PASSED] 39 VFs [14:22:06] [PASSED] 40 VFs [14:22:06] [PASSED] 41 VFs [14:22:06] [PASSED] 42 VFs [14:22:06] [PASSED] 43 VFs [14:22:06] [PASSED] 44 VFs [14:22:06] [PASSED] 45 VFs [14:22:06] [PASSED] 46 VFs [14:22:06] [PASSED] 47 VFs [14:22:06] [PASSED] 48 VFs [14:22:06] [PASSED] 49 VFs [14:22:06] [PASSED] 50 VFs [14:22:06] [PASSED] 51 VFs [14:22:06] [PASSED] 52 VFs [14:22:06] [PASSED] 53 VFs [14:22:06] [PASSED] 54 VFs [14:22:06] [PASSED] 55 VFs [14:22:06] [PASSED] 56 VFs [14:22:06] [PASSED] 57 VFs [14:22:06] [PASSED] 58 VFs [14:22:06] [PASSED] 59 VFs [14:22:06] [PASSED] 60 VFs [14:22:06] [PASSED] 61 VFs [14:22:06] [PASSED] 62 VFs [14:22:06] [PASSED] 63 VFs [14:22:06] ================= [PASSED] fair_doorbells ================== [14:22:06] ======================== fair_ggtt ======================== [14:22:06] [PASSED] 1 VF [14:22:06] [PASSED] 2 VFs [14:22:06] [PASSED] 3 VFs [14:22:06] [PASSED] 4 VFs [14:22:06] [PASSED] 5 VFs [14:22:06] [PASSED] 6 VFs [14:22:06] [PASSED] 7 VFs [14:22:06] [PASSED] 8 VFs [14:22:06] [PASSED] 9 VFs [14:22:06] [PASSED] 10 VFs [14:22:06] [PASSED] 11 VFs [14:22:06] [PASSED] 12 VFs [14:22:06] [PASSED] 13 VFs [14:22:06] [PASSED] 14 VFs [14:22:06] [PASSED] 15 VFs [14:22:06] [PASSED] 16 VFs [14:22:06] [PASSED] 17 VFs [14:22:06] [PASSED] 18 VFs [14:22:06] [PASSED] 19 VFs [14:22:06] [PASSED] 20 VFs [14:22:06] [PASSED] 21 VFs [14:22:06] [PASSED] 22 VFs [14:22:06] [PASSED] 23 VFs [14:22:06] [PASSED] 24 VFs [14:22:06] [PASSED] 25 VFs [14:22:06] [PASSED] 26 VFs [14:22:06] [PASSED] 27 VFs [14:22:06] [PASSED] 28 VFs [14:22:06] [PASSED] 29 VFs [14:22:06] [PASSED] 30 VFs [14:22:06] [PASSED] 31 VFs [14:22:06] [PASSED] 32 VFs [14:22:06] [PASSED] 33 VFs [14:22:06] [PASSED] 34 VFs [14:22:06] [PASSED] 35 VFs [14:22:06] [PASSED] 36 VFs [14:22:06] [PASSED] 37 VFs [14:22:06] [PASSED] 38 VFs [14:22:06] [PASSED] 39 VFs [14:22:06] [PASSED] 40 VFs [14:22:06] [PASSED] 41 VFs [14:22:06] [PASSED] 42 VFs [14:22:06] [PASSED] 43 VFs [14:22:06] [PASSED] 44 VFs [14:22:06] [PASSED] 45 VFs [14:22:06] [PASSED] 46 VFs [14:22:06] [PASSED] 47 VFs [14:22:06] [PASSED] 48 VFs [14:22:06] [PASSED] 49 VFs [14:22:06] [PASSED] 50 VFs [14:22:06] [PASSED] 51 VFs [14:22:06] [PASSED] 52 VFs [14:22:06] [PASSED] 53 VFs [14:22:06] [PASSED] 54 VFs [14:22:06] [PASSED] 55 VFs [14:22:06] [PASSED] 56 VFs [14:22:06] [PASSED] 57 VFs [14:22:06] [PASSED] 58 VFs [14:22:06] [PASSED] 59 VFs [14:22:06] [PASSED] 60 VFs [14:22:06] [PASSED] 61 VFs [14:22:06] [PASSED] 62 VFs [14:22:06] [PASSED] 63 VFs [14:22:06] ==================== [PASSED] fair_ggtt ==================== [14:22:06] ======================== fair_vram ======================== [14:22:06] [PASSED] 1 VF [14:22:06] [PASSED] 2 VFs [14:22:06] [PASSED] 3 VFs [14:22:06] [PASSED] 4 VFs [14:22:06] [PASSED] 5 VFs [14:22:06] [PASSED] 6 VFs [14:22:06] [PASSED] 7 VFs [14:22:06] [PASSED] 8 VFs [14:22:06] [PASSED] 9 VFs [14:22:06] [PASSED] 10 VFs [14:22:06] [PASSED] 11 VFs [14:22:06] [PASSED] 12 VFs [14:22:06] [PASSED] 13 VFs [14:22:06] [PASSED] 14 VFs [14:22:06] [PASSED] 15 VFs [14:22:06] [PASSED] 16 VFs [14:22:06] [PASSED] 17 VFs [14:22:06] [PASSED] 18 VFs [14:22:06] [PASSED] 19 VFs [14:22:06] [PASSED] 20 VFs [14:22:06] [PASSED] 21 VFs [14:22:06] [PASSED] 22 VFs [14:22:06] [PASSED] 23 VFs [14:22:06] [PASSED] 24 VFs [14:22:06] [PASSED] 25 VFs [14:22:06] [PASSED] 26 VFs [14:22:06] [PASSED] 27 VFs [14:22:06] [PASSED] 28 VFs [14:22:06] [PASSED] 29 VFs [14:22:06] [PASSED] 30 VFs [14:22:06] [PASSED] 31 VFs [14:22:06] [PASSED] 32 VFs [14:22:06] [PASSED] 33 VFs [14:22:06] [PASSED] 34 VFs [14:22:06] [PASSED] 35 VFs [14:22:06] [PASSED] 36 VFs [14:22:06] [PASSED] 37 VFs [14:22:06] [PASSED] 38 VFs [14:22:06] [PASSED] 39 VFs [14:22:06] [PASSED] 40 VFs [14:22:06] [PASSED] 41 VFs [14:22:06] [PASSED] 42 VFs [14:22:06] [PASSED] 43 VFs [14:22:06] [PASSED] 44 VFs [14:22:06] [PASSED] 45 VFs [14:22:06] [PASSED] 46 VFs [14:22:06] [PASSED] 47 VFs [14:22:06] [PASSED] 48 VFs [14:22:06] [PASSED] 49 VFs [14:22:06] [PASSED] 50 VFs [14:22:06] [PASSED] 51 VFs [14:22:06] [PASSED] 52 VFs [14:22:06] [PASSED] 53 VFs [14:22:06] [PASSED] 54 VFs [14:22:06] [PASSED] 55 VFs [14:22:06] [PASSED] 56 VFs [14:22:06] [PASSED] 57 VFs [14:22:06] [PASSED] 58 VFs [14:22:06] [PASSED] 59 VFs [14:22:06] [PASSED] 60 VFs [14:22:06] [PASSED] 61 VFs [14:22:06] [PASSED] 62 VFs [14:22:06] [PASSED] 63 VFs [14:22:06] ==================== [PASSED] fair_vram ==================== [14:22:06] ================== [PASSED] pf_gt_config =================== [14:22:06] ===================== lmtt (1 subtest) ===================== [14:22:06] ======================== test_ops ========================= [14:22:06] [PASSED] 2-level [14:22:06] [PASSED] multi-level [14:22:06] ==================== [PASSED] test_ops ===================== [14:22:06] ====================== [PASSED] lmtt ======================= [14:22:06] ================= sriov_packet (1 subtest) ================= [14:22:06] [PASSED] test_descriptor_init [14:22:06] ================== [PASSED] sriov_packet =================== [14:22:06] ================= pf_service (11 subtests) ================= [14:22:06] [PASSED] pf_negotiate_any [14:22:06] [PASSED] pf_negotiate_base_match [14:22:06] [PASSED] pf_negotiate_base_newer [14:22:06] [PASSED] pf_negotiate_base_next [14:22:06] [SKIPPED] pf_negotiate_base_older (no older minor) [14:22:06] [PASSED] pf_negotiate_base_prev [14:22:06] [PASSED] pf_negotiate_latest_match [14:22:06] [PASSED] pf_negotiate_latest_newer [14:22:06] [PASSED] pf_negotiate_latest_next [14:22:06] [SKIPPED] pf_negotiate_latest_older (no older minor) [14:22:06] [SKIPPED] pf_negotiate_latest_prev (no prev major) [14:22:06] =================== [PASSED] pf_service ==================== [14:22:06] ================= xe_guc_g2g (2 subtests) ================== [14:22:06] ============== xe_live_guc_g2g_kunit_default ============== [14:22:06] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ========== [14:22:06] ============== xe_live_guc_g2g_kunit_allmem =============== [14:22:06] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ========== [14:22:06] =================== [SKIPPED] xe_guc_g2g =================== [14:22:06] =================== xe_mocs (2 subtests) =================== [14:22:06] ================ xe_live_mocs_kernel_kunit ================ [14:22:06] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============ [14:22:06] ================ xe_live_mocs_reset_kunit ================= [14:22:06] ============ [SKIPPED] xe_live_mocs_reset_kunit ============ [14:22:06] ==================== [SKIPPED] xe_mocs ===================== [14:22:06] ================= xe_migrate (2 subtests) ================== [14:22:06] ================= xe_migrate_sanity_kunit ================= [14:22:06] ============ [SKIPPED] xe_migrate_sanity_kunit ============= [14:22:06] ================== xe_validate_ccs_kunit ================== [14:22:06] ============= [SKIPPED] xe_validate_ccs_kunit ============== [14:22:06] =================== [SKIPPED] xe_migrate =================== [14:22:06] ================== xe_dma_buf (1 subtest) ================== [14:22:06] ==================== xe_dma_buf_kunit ===================== [14:22:06] ================ [SKIPPED] xe_dma_buf_kunit ================ [14:22:06] =================== [SKIPPED] xe_dma_buf =================== [14:22:06] ================= xe_bo_shrink (1 subtest) ================= [14:22:06] =================== xe_bo_shrink_kunit ==================== [14:22:06] =============== [SKIPPED] xe_bo_shrink_kunit =============== [14:22:06] ================== [SKIPPED] xe_bo_shrink ================== [14:22:06] ==================== xe_bo (2 subtests) ==================== [14:22:06] ================== xe_ccs_migrate_kunit =================== [14:22:06] ============== [SKIPPED] xe_ccs_migrate_kunit ============== [14:22:06] ==================== xe_bo_evict_kunit ==================== [14:22:06] =============== [SKIPPED] xe_bo_evict_kunit ================ [14:22:06] ===================== [SKIPPED] xe_bo ====================== [14:22:06] =================== xe_any (9 subtests) ==================== [14:22:06] [PASSED] test_to_xe [14:22:06] [PASSED] test_to_dev [14:22:06] [PASSED] test_to_pdev [14:22:06] [PASSED] test_to_drm [14:22:06] [PASSED] test_if_pdev [14:22:06] [PASSED] test_if_xe [14:22:06] [PASSED] test_if_tile [14:22:06] [PASSED] test_if_gt [14:22:06] [PASSED] test_to_id [14:22:06] ===================== [PASSED] xe_any ====================== [14:22:06] ==================== args (13 subtests) ==================== [14:22:06] [PASSED] count_args_test [14:22:06] [PASSED] call_args_example [14:22:06] [PASSED] call_args_test [14:22:06] [PASSED] drop_first_arg_example [14:22:06] [PASSED] drop_first_arg_test [14:22:06] [PASSED] first_arg_example [14:22:06] [PASSED] first_arg_test [14:22:06] [PASSED] last_arg_example [14:22:06] [PASSED] last_arg_test [14:22:06] [PASSED] pick_arg_example [14:22:06] [PASSED] if_args_example [14:22:06] [PASSED] if_args_test [14:22:06] [PASSED] sep_comma_example [14:22:06] ====================== [PASSED] args ======================= [14:22:06] =================== xe_pci (3 subtests) ==================== [14:22:06] ==================== check_graphics_ip ==================== [14:22:06] [PASSED] 12.00 Xe_LP [14:22:06] [PASSED] 12.10 Xe_LP+ [14:22:06] [PASSED] 12.55 Xe_HPG [14:22:06] [PASSED] 12.60 Xe_HPC [14:22:06] [PASSED] 12.70 Xe_LPG [14:22:06] [PASSED] 12.71 Xe_LPG [14:22:06] [PASSED] 12.74 Xe_LPG+ [14:22:06] [PASSED] 20.01 Xe2_HPG [14:22:06] [PASSED] 20.02 Xe2_HPG [14:22:06] [PASSED] 20.04 Xe2_LPG [14:22:06] [PASSED] 30.00 Xe3_LPG [14:22:06] [PASSED] 30.01 Xe3_LPG [14:22:06] [PASSED] 30.03 Xe3_LPG [14:22:06] [PASSED] 30.04 Xe3_LPG [14:22:06] [PASSED] 30.05 Xe3_LPG [14:22:06] [PASSED] 35.10 Xe3p_LPG [14:22:06] [PASSED] 35.11 Xe3p_XPC [14:22:06] ================ [PASSED] check_graphics_ip ================ [14:22:06] ===================== check_media_ip ====================== [14:22:06] [PASSED] 12.00 Xe_M [14:22:06] [PASSED] 12.55 Xe_HPM [14:22:06] [PASSED] 13.00 Xe_LPM+ [14:22:06] [PASSED] 13.01 Xe2_HPM [14:22:06] [PASSED] 20.00 Xe2_LPM [14:22:06] [PASSED] 30.00 Xe3_LPM [14:22:06] [PASSED] 30.02 Xe3_LPM [14:22:06] [PASSED] 35.00 Xe3p_LPM [14:22:06] [PASSED] 35.03 Xe3p_HPM [14:22:06] ================= [PASSED] check_media_ip ================== [14:22:06] =================== check_platform_desc =================== [14:22:06] [PASSED] 0x9A60 (TIGERLAKE) [14:22:06] [PASSED] 0x9A68 (TIGERLAKE) [14:22:06] [PASSED] 0x9A70 (TIGERLAKE) [14:22:06] [PASSED] 0x9A40 (TIGERLAKE) [14:22:06] [PASSED] 0x9A49 (TIGERLAKE) [14:22:06] [PASSED] 0x9A59 (TIGERLAKE) [14:22:06] [PASSED] 0x9A78 (TIGERLAKE) [14:22:06] [PASSED] 0x9AC0 (TIGERLAKE) [14:22:06] [PASSED] 0x9AC9 (TIGERLAKE) [14:22:06] [PASSED] 0x9AD9 (TIGERLAKE) [14:22:06] [PASSED] 0x9AF8 (TIGERLAKE) [14:22:06] [PASSED] 0x4C80 (ROCKETLAKE) [14:22:06] [PASSED] 0x4C8A (ROCKETLAKE) [14:22:06] [PASSED] 0x4C8B (ROCKETLAKE) [14:22:06] [PASSED] 0x4C8C (ROCKETLAKE) [14:22:06] [PASSED] 0x4C90 (ROCKETLAKE) [14:22:06] [PASSED] 0x4C9A (ROCKETLAKE) [14:22:06] [PASSED] 0x4680 (ALDERLAKE_S) [14:22:06] [PASSED] 0x4682 (ALDERLAKE_S) [14:22:06] [PASSED] 0x4688 (ALDERLAKE_S) [14:22:06] [PASSED] 0x468A (ALDERLAKE_S) [14:22:06] [PASSED] 0x468B (ALDERLAKE_S) [14:22:06] [PASSED] 0x4690 (ALDERLAKE_S) [14:22:06] [PASSED] 0x4692 (ALDERLAKE_S) [14:22:06] [PASSED] 0x4693 (ALDERLAKE_S) [14:22:06] [PASSED] 0x46A0 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46A1 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46A2 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46A3 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46A6 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46A8 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46AA (ALDERLAKE_P) [14:22:06] [PASSED] 0x462A (ALDERLAKE_P) [14:22:06] [PASSED] 0x4626 (ALDERLAKE_P) [14:22:06] [PASSED] 0x4628 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46B0 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46B1 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46B2 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46B3 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46C0 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46C1 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46C2 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46C3 (ALDERLAKE_P) [14:22:06] [PASSED] 0x46D0 (ALDERLAKE_N) [14:22:06] [PASSED] 0x46D1 (ALDERLAKE_N) [14:22:06] [PASSED] 0x46D2 (ALDERLAKE_N) [14:22:06] [PASSED] 0x46D3 (ALDERLAKE_N) [14:22:06] [PASSED] 0x46D4 (ALDERLAKE_N) [14:22:06] [PASSED] 0xA721 (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7A1 (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7A9 (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7AC (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7AD (ALDERLAKE_P) [14:22:06] [PASSED] 0xA720 (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7A0 (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7A8 (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7AA (ALDERLAKE_P) [14:22:06] [PASSED] 0xA7AB (ALDERLAKE_P) [14:22:06] [PASSED] 0xA780 (ALDERLAKE_S) [14:22:06] [PASSED] 0xA781 (ALDERLAKE_S) [14:22:06] [PASSED] 0xA782 (ALDERLAKE_S) [14:22:06] [PASSED] 0xA783 (ALDERLAKE_S) [14:22:06] [PASSED] 0xA788 (ALDERLAKE_S) [14:22:06] [PASSED] 0xA789 (ALDERLAKE_S) [14:22:06] [PASSED] 0xA78A (ALDERLAKE_S) [14:22:06] [PASSED] 0xA78B (ALDERLAKE_S) [14:22:06] [PASSED] 0x4905 (DG1) [14:22:06] [PASSED] 0x4906 (DG1) [14:22:06] [PASSED] 0x4907 (DG1) [14:22:06] [PASSED] 0x4908 (DG1) [14:22:06] [PASSED] 0x4909 (DG1) [14:22:06] [PASSED] 0x56C0 (DG2) [14:22:06] [PASSED] 0x56C2 (DG2) [14:22:06] [PASSED] 0x56C1 (DG2) [14:22:06] [PASSED] 0x7D51 (METEORLAKE) [14:22:06] [PASSED] 0x7DD1 (METEORLAKE) [14:22:06] [PASSED] 0x7D41 (METEORLAKE) [14:22:06] [PASSED] 0x7D67 (METEORLAKE) [14:22:06] [PASSED] 0xB640 (METEORLAKE) [14:22:06] [PASSED] 0x56A0 (DG2) [14:22:06] [PASSED] 0x56A1 (DG2) [14:22:06] [PASSED] 0x56A2 (DG2) [14:22:06] [PASSED] 0x56BE (DG2) [14:22:06] [PASSED] 0x56BF (DG2) [14:22:06] [PASSED] 0x5690 (DG2) [14:22:06] [PASSED] 0x5691 (DG2) [14:22:06] [PASSED] 0x5692 (DG2) [14:22:06] [PASSED] 0x56A5 (DG2) [14:22:06] [PASSED] 0x56A6 (DG2) [14:22:06] [PASSED] 0x56B0 (DG2) [14:22:06] [PASSED] 0x56B1 (DG2) [14:22:06] [PASSED] 0x56BA (DG2) [14:22:06] [PASSED] 0x56BB (DG2) [14:22:06] [PASSED] 0x56BC (DG2) [14:22:06] [PASSED] 0x56BD (DG2) [14:22:06] [PASSED] 0x5693 (DG2) [14:22:06] [PASSED] 0x5694 (DG2) [14:22:06] [PASSED] 0x5695 (DG2) [14:22:06] [PASSED] 0x56A3 (DG2) [14:22:06] [PASSED] 0x56A4 (DG2) [14:22:06] [PASSED] 0x56B2 (DG2) [14:22:06] [PASSED] 0x56B3 (DG2) [14:22:06] [PASSED] 0x5696 (DG2) [14:22:06] [PASSED] 0x5697 (DG2) [14:22:06] [PASSED] 0xB69 (PVC) [14:22:06] [PASSED] 0xB6E (PVC) [14:22:06] [PASSED] 0xBD4 (PVC) [14:22:06] [PASSED] 0xBD5 (PVC) [14:22:06] [PASSED] 0xBD6 (PVC) [14:22:06] [PASSED] 0xBD7 (PVC) [14:22:06] [PASSED] 0xBD8 (PVC) [14:22:06] [PASSED] 0xBD9 (PVC) [14:22:06] [PASSED] 0xBDA (PVC) [14:22:06] [PASSED] 0xBDB (PVC) [14:22:06] [PASSED] 0xBE0 (PVC) [14:22:06] [PASSED] 0xBE1 (PVC) [14:22:06] [PASSED] 0xBE5 (PVC) [14:22:06] [PASSED] 0x7D40 (METEORLAKE) [14:22:06] [PASSED] 0x7D45 (METEORLAKE) [14:22:06] [PASSED] 0x7D55 (METEORLAKE) [14:22:06] [PASSED] 0x7D60 (METEORLAKE) [14:22:06] [PASSED] 0x7DD5 (METEORLAKE) [14:22:06] [PASSED] 0x6420 (LUNARLAKE) [14:22:06] [PASSED] 0x64A0 (LUNARLAKE) [14:22:06] [PASSED] 0x64B0 (LUNARLAKE) [14:22:06] [PASSED] 0xE202 (BATTLEMAGE) [14:22:06] [PASSED] 0xE209 (BATTLEMAGE) [14:22:06] [PASSED] 0xE20B (BATTLEMAGE) [14:22:06] [PASSED] 0xE20C (BATTLEMAGE) [14:22:06] [PASSED] 0xE20D (BATTLEMAGE) [14:22:06] [PASSED] 0xE210 (BATTLEMAGE) [14:22:06] [PASSED] 0xE211 (BATTLEMAGE) [14:22:06] [PASSED] 0xE212 (BATTLEMAGE) [14:22:06] [PASSED] 0xE216 (BATTLEMAGE) [14:22:06] [PASSED] 0xE220 (BATTLEMAGE) [14:22:06] [PASSED] 0xE221 (BATTLEMAGE) [14:22:06] [PASSED] 0xE222 (BATTLEMAGE) [14:22:06] [PASSED] 0xE223 (BATTLEMAGE) [14:22:06] [PASSED] 0xB080 (PANTHERLAKE) [14:22:06] [PASSED] 0xB081 (PANTHERLAKE) [14:22:06] [PASSED] 0xB082 (PANTHERLAKE) [14:22:06] [PASSED] 0xB083 (PANTHERLAKE) [14:22:06] [PASSED] 0xB084 (PANTHERLAKE) [14:22:06] [PASSED] 0xB085 (PANTHERLAKE) [14:22:06] [PASSED] 0xB086 (PANTHERLAKE) [14:22:06] [PASSED] 0xB087 (PANTHERLAKE) [14:22:06] [PASSED] 0xB08F (PANTHERLAKE) [14:22:06] [PASSED] 0xB090 (PANTHERLAKE) [14:22:06] [PASSED] 0xB0A0 (PANTHERLAKE) [14:22:06] [PASSED] 0xB0B0 (PANTHERLAKE) [14:22:06] [PASSED] 0xFD80 (PANTHERLAKE) [14:22:06] [PASSED] 0xFD81 (PANTHERLAKE) [14:22:06] [PASSED] 0xD740 (NOVALAKE_S) [14:22:06] [PASSED] 0xD741 (NOVALAKE_S) [14:22:06] [PASSED] 0xD742 (NOVALAKE_S) [14:22:06] [PASSED] 0xD743 (NOVALAKE_S) [14:22:06] [PASSED] 0xD745 (NOVALAKE_S) [14:22:06] [PASSED] 0xD74A (NOVALAKE_S) [14:22:06] [PASSED] 0xD74B (NOVALAKE_S) [14:22:06] [PASSED] 0x674C (CRESCENTISLAND) [14:22:06] [PASSED] 0x674D (CRESCENTISLAND) [14:22:06] [PASSED] 0x674E (CRESCENTISLAND) [14:22:06] [PASSED] 0x674F (CRESCENTISLAND) [14:22:06] [PASSED] 0x6750 (CRESCENTISLAND) [14:22:06] [PASSED] 0xD750 (NOVALAKE_P) [14:22:06] [PASSED] 0xD751 (NOVALAKE_P) [14:22:06] [PASSED] 0xD752 (NOVALAKE_P) [14:22:06] [PASSED] 0xD753 (NOVALAKE_P) [14:22:06] [PASSED] 0xD754 (NOVALAKE_P) [14:22:06] [PASSED] 0xD755 (NOVALAKE_P) [14:22:06] [PASSED] 0xD756 (NOVALAKE_P) [14:22:06] [PASSED] 0xD757 (NOVALAKE_P) [14:22:06] [PASSED] 0xD75F (NOVALAKE_P) [14:22:06] =============== [PASSED] check_platform_desc =============== [14:22:06] ===================== [PASSED] xe_pci ====================== [14:22:06] ============= xe_rtp_tables_test (5 subtests) ============== [14:22:06] ================== xe_rtp_table_gt_test =================== [14:22:06] [PASSED] gt_was/14011060649 [14:22:06] [PASSED] gt_was/14011059788 [14:22:06] [PASSED] gt_was/14015795083 [14:22:06] [PASSED] gt_was/16021867713 [14:22:06] [PASSED] gt_was/14019449301 [14:22:06] [PASSED] gt_was/16028005424 [14:22:06] [PASSED] gt_was/14026578760 [14:22:06] [PASSED] gt_was/1409420604 [14:22:06] [PASSED] gt_was/1408615072 [14:22:06] [PASSED] gt_was/22010523718 [14:22:06] [PASSED] gt_was/14011006942 [14:22:06] [PASSED] gt_was/14014830051 [14:22:06] [PASSED] gt_was/18018781329 [14:22:06] [PASSED] gt_was/1509235366 [14:22:06] [PASSED] gt_was/18018781329 [14:22:06] [PASSED] gt_was/16016694945 [14:22:06] [PASSED] gt_was/14018575942 [14:22:06] [PASSED] gt_was/22016670082 [14:22:06] [PASSED] gt_was/22016670082 [14:22:06] [PASSED] gt_was/14017421178 [14:22:06] [PASSED] gt_was/16025250150 [14:22:06] [PASSED] gt_was/14021871409 [14:22:06] [PASSED] gt_was/16021865536 [14:22:06] [PASSED] gt_was/14021486841 [14:22:06] [PASSED] gt_was/14025160223 [14:22:06] [PASSED] gt_was/14026144927, 16029437861, 14026127056 [14:22:06] [PASSED] gt_was/14025635424 [14:22:06] [PASSED] gt_was/16028005424 [14:22:06] ============== [PASSED] xe_rtp_table_gt_test =============== [14:22:06] ================== xe_rtp_table_gt_test =================== [14:22:06] [PASSED] gt_tunings/Tuning: Blend Fill Caching Optimization Disable [14:22:06] [PASSED] gt_tunings/Tuning: 32B Access Enable [14:22:06] [PASSED] gt_tunings/Tuning: L3 cache [14:22:06] [PASSED] gt_tunings/Tuning: L3 cache - media [14:22:06] [PASSED] gt_tunings/Tuning: Compression Overfetch [14:22:06] [PASSED] gt_tunings/Tuning: Compression Overfetch - media [14:22:06] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3 [14:22:06] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3 - media [14:22:06] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only [14:22:06] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only - media [14:22:06] [PASSED] gt_tunings/Tuning: Stateless compression control [14:22:06] [PASSED] gt_tunings/Tuning: Stateless compression control - media [14:22:06] [PASSED] gt_tunings/Tuning: L3 RW flush all Cache [14:22:06] [PASSED] gt_tunings/Tuning: L3 RW flush all cache - media [14:22:06] [PASSED] gt_tunings/Tuning: Set STLB Bank Hash Mode to 4KB [14:22:06] ============== [PASSED] xe_rtp_table_gt_test =============== [14:22:06] ================== xe_rtp_table_oob_test ================== [14:22:06] [PASSED] oob_was/1607983814 [14:22:06] [PASSED] oob_was/16010904313 [14:22:06] [PASSED] oob_was/18022495364 [14:22:06] [PASSED] oob_was/22012773006 [14:22:06] [PASSED] oob_was/14014475959 [14:22:06] [PASSED] oob_was/22011391025 [14:22:06] [PASSED] oob_was/22012727170 [14:22:06] [PASSED] oob_was/22012727685 [14:22:06] [PASSED] oob_was/22016596838 [14:22:06] [PASSED] oob_was/18020744125 [14:22:06] [PASSED] oob_was/1409600907 [14:22:06] [PASSED] oob_was/22014953428 [14:22:06] [PASSED] oob_was/16017236439 [14:22:06] [PASSED] oob_was/14019821291 [14:22:06] [PASSED] oob_was/14015076503 [14:22:06] [PASSED] oob_was/14018913170 [14:22:06] [PASSED] oob_was/14018094691 [14:22:06] [PASSED] oob_was/18024947630 [14:22:06] [PASSED] oob_was/16022287689 [14:22:06] [PASSED] oob_was/13011645652 [14:22:06] [PASSED] oob_was/14022293748 [14:22:06] [PASSED] oob_was/22019794406 [14:22:06] [PASSED] oob_was/22019338487 [14:22:06] [PASSED] oob_was/16023588340 [14:22:06] [PASSED] oob_was/14019789679 [14:22:06] [PASSED] oob_was/14022866841 [14:22:06] [PASSED] oob_was/16021333562 [14:22:06] [PASSED] oob_was/14016712196 [14:22:06] [PASSED] oob_was/14015568240 [14:22:06] [PASSED] oob_was/18013179988 [14:22:06] [PASSED] oob_was/1508761755 [14:22:06] [PASSED] oob_was/16023105232 [14:22:06] [PASSED] oob_was/16026508708 [14:22:06] [PASSED] oob_was/14020001231 [14:22:06] [PASSED] oob_was/16023683509 [14:22:06] [PASSED] oob_was/14025515070 [14:22:06] [PASSED] oob_was/15015404425_disable [14:22:06] [PASSED] oob_was/16026007364 [14:22:06] [PASSED] oob_was/14020316580 [14:22:06] [PASSED] oob_was/14025883347 [14:22:06] [PASSED] oob_was/16029380221 [14:22:06] [PASSED] oob_was/22022079272 [14:22:06] [PASSED] oob_was/16029897822 [14:22:06] [PASSED] oob_was/14027054324 [14:22:06] ============== [PASSED] xe_rtp_table_oob_test ============== [14:22:06] ================ xe_rtp_table_dev_oob_test ================ [14:22:06] [PASSED] device_oob_was/22010954014 [14:22:06] [PASSED] device_oob_was/15015404425 [14:22:06] [PASSED] device_oob_was/22019338487_display [14:22:06] [PASSED] device_oob_was/14022085890 [14:22:06] [PASSED] device_oob_was/14026539277 [14:22:06] [PASSED] device_oob_was/14026633728 [14:22:06] [PASSED] device_oob_was/14026746987 [14:22:06] [PASSED] device_oob_was/14026779378 [14:22:06] ============ [PASSED] xe_rtp_table_dev_oob_test ============ [14:22:06] ========== xe_rtp_table_missing_upper_bound_test ========== [14:22:06] [PASSED] register_whitelist/WaAllowPMDepthAndInvocationCountAccessFromUMD, 1408556865 [14:22:06] [PASSED] register_whitelist/1508744258, 14012131227, 1808121037 [14:22:06] [PASSED] register_whitelist/1806527549 [14:22:06] [PASSED] register_whitelist/allow_read_ctx_timestamp [14:22:06] [PASSED] register_whitelist/allow_read_queue_timestamp [14:22:06] [PASSED] register_whitelist/16014440446 [14:22:06] [PASSED] register_whitelist/16017236439 [14:22:06] [PASSED] register_whitelist/16020183090 [14:22:06] [PASSED] register_whitelist/14024997852 [14:22:06] [PASSED] register_whitelist/14024997852 [14:22:06] ====== [PASSED] xe_rtp_table_missing_upper_bound_test ====== [14:22:06] =============== [PASSED] xe_rtp_tables_test ================ [14:22:06] =================== xe_rtp (3 subtests) ==================== [14:22:06] =================== xe_rtp_rules_tests ==================== [14:22:06] [PASSED] no [14:22:06] [PASSED] yes [14:22:06] [PASSED] no-and-no [14:22:06] [PASSED] no-and-yes [14:22:06] [PASSED] yes-and-no [14:22:06] [PASSED] yes-and-yes [14:22:06] [PASSED] no-or-no [14:22:06] [PASSED] no-or-yes [14:22:06] [PASSED] yes-or-no [14:22:06] [PASSED] yes-or-yes [14:22:06] [PASSED] no-yes-or-yes-no [14:22:06] [PASSED] no-yes-or-yes-yes [14:22:06] [PASSED] yes-yes-or-no-yes [14:22:06] [PASSED] yes-yes-or-yes-yes [14:22:06] [PASSED] no-no-or-yes-or-no [14:22:06] [PASSED] or [14:22:06] [PASSED] or-yes [14:22:06] [PASSED] or-no [14:22:06] [PASSED] yes-or [14:22:06] [PASSED] no-or [14:22:06] [PASSED] no-or-or-yes [14:22:06] [PASSED] yes-or-or-no [14:22:06] [PASSED] no-or-or-no [14:22:06] [PASSED] missing-context-engine-class [14:22:06] [PASSED] missing-context-engine-class-or-yes [14:22:06] [PASSED] missing-context-engine-class-or-or-yes [14:22:06] =============== [PASSED] xe_rtp_rules_tests ================ [14:22:06] =============== xe_rtp_process_to_sr_tests ================ [14:22:06] [PASSED] coalesce-same-reg [14:22:06] [PASSED] coalesce-same-reg-literal-and-func [14:22:06] [PASSED] no-match-no-add [14:22:06] [PASSED] two-regs-two-entries [14:22:06] [PASSED] clr-one-set-other [14:22:06] [PASSED] set-field [14:22:06] [PASSED] conflict-duplicate [14:22:06] [PASSED] conflict-not-disjoint [14:22:06] [PASSED] conflict-not-disjoint-literal-and-func [14:22:06] [PASSED] conflict-reg-type [14:22:06] [PASSED] bad-mcr-reg-forced-to-regular [14:22:06] [PASSED] bad-regular-reg-forced-to-mcr [14:22:06] =========== [PASSED] xe_rtp_process_to_sr_tests ============ [14:22:06] ================== xe_rtp_process_tests =================== [14:22:06] [PASSED] active1 [14:22:06] [PASSED] active2 [14:22:06] [PASSED] active-inactive [14:22:06] [PASSED] inactive-active [14:22:06] [PASSED] inactive-active-inactive [14:22:06] [PASSED] inactive-inactive-inactive [14:22:06] ============== [PASSED] xe_rtp_process_tests =============== [14:22:06] ===================== [PASSED] xe_rtp ====================== [14:22:06] ==================== xe_wa (1 subtest) ===================== [14:22:06] ======================== xe_wa_gt ========================= [14:22:06] [PASSED] TIGERLAKE B0 [14:22:06] [PASSED] DG1 A0 [14:22:06] [PASSED] DG1 B0 [14:22:06] [PASSED] ALDERLAKE_S A0 [14:22:06] [PASSED] ALDERLAKE_S B0 [14:22:06] [PASSED] ALDERLAKE_S C0 [14:22:06] [PASSED] ALDERLAKE_S D0 [14:22:06] [PASSED] ALDERLAKE_P A0 [14:22:06] [PASSED] ALDERLAKE_P B0 [14:22:06] [PASSED] ALDERLAKE_P C0 [14:22:06] [PASSED] ALDERLAKE_S RPLS D0 [14:22:06] [PASSED] ALDERLAKE_P RPLU E0 [14:22:06] [PASSED] DG2 G10 C0 [14:22:06] [PASSED] DG2 G11 B1 [14:22:06] [PASSED] DG2 G12 A1 [14:22:06] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0 [14:22:06] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0 [14:22:06] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0 [14:22:06] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0 [14:22:06] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0 [14:22:06] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1 [14:22:06] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0 [14:22:06] ==================== [PASSED] xe_wa_gt ===================== [14:22:06] ====================== [PASSED] xe_wa ====================== [14:22:06] ============================================================ [14:22:06] Testing complete. Ran 793 tests: passed: 765, skipped: 28 [14:22:06] Elapsed time: 35.999s total, 1.803s configuring, 33.481s building, 0.705s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig [14:22:07] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [14:22:08] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [14:22:33] Starting KUnit Kernel (1/1)... [14:22:33] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [14:22:33] ============= refcount_interrupt (4 subtests) ============== [14:22:33] [PASSED] test_single_irq_change [14:22:33] [PASSED] test_nested_irq_change [14:22:33] [PASSED] test_multiple_irq_change [14:22:33] [PASSED] test_irq_save [14:22:33] =============== [PASSED] refcount_interrupt ================ [14:22:33] ============ drm_test_pick_cmdline (2 subtests) ============ [14:22:33] [PASSED] drm_test_pick_cmdline_res_1920_1080_60 [14:22:33] =============== drm_test_pick_cmdline_named =============== [14:22:33] [PASSED] NTSC [14:22:33] [PASSED] NTSC-J [14:22:33] [PASSED] PAL [14:22:33] [PASSED] PAL-M [14:22:33] =========== [PASSED] drm_test_pick_cmdline_named =========== [14:22:33] ============== [PASSED] drm_test_pick_cmdline ============== [14:22:33] == drm_test_atomic_get_connector_for_encoder (1 subtest) === [14:22:33] [PASSED] drm_test_drm_atomic_get_connector_for_encoder [14:22:33] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ==== [14:22:33] =========== drm_validate_clone_mode (2 subtests) =========== [14:22:33] ============== drm_test_check_in_clone_mode =============== [14:22:33] [PASSED] in_clone_mode [14:22:33] [PASSED] not_in_clone_mode [14:22:33] ========== [PASSED] drm_test_check_in_clone_mode =========== [14:22:33] =============== drm_test_check_valid_clones =============== [14:22:33] [PASSED] not_in_clone_mode [14:22:33] [PASSED] valid_clone [14:22:33] [PASSED] invalid_clone [14:22:33] =========== [PASSED] drm_test_check_valid_clones =========== [14:22:33] ============= [PASSED] drm_validate_clone_mode ============= [14:22:33] ============= drm_validate_modeset (1 subtest) ============= [14:22:33] [PASSED] drm_test_check_connector_changed_modeset [14:22:33] ============== [PASSED] drm_validate_modeset =============== [14:22:33] ====== drm_test_bridge_get_current_state (1 subtest) ======= [14:22:33] [PASSED] drm_test_drm_bridge_get_current_state_atomic [14:22:33] ======== [PASSED] drm_test_bridge_get_current_state ======== [14:22:33] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ====== [14:22:33] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic [14:22:33] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled [14:22:33] [PASSED] drm_test_drm_bridge_helper_hdmi_output_bus_fmts [14:22:33] ======== [PASSED] drm_test_bridge_helper_reset_crtc ======== [14:22:33] ============== drm_bridge_alloc (2 subtests) =============== [14:22:33] [PASSED] drm_test_drm_bridge_alloc_basic [14:22:33] [PASSED] drm_test_drm_bridge_alloc_get_put [14:22:33] ================ [PASSED] drm_bridge_alloc ================= [14:22:33] ============= drm_bridge_bus_fmt (5 subtests) ============== [14:22:33] [PASSED] drm_test_bridge_rgb_yuv_rgb [14:22:33] [PASSED] drm_test_bridge_must_convert_to_yuv444 [14:22:33] [PASSED] drm_test_bridge_hdmi_auto_rgb [14:22:33] [PASSED] drm_test_bridge_auto_first [14:22:33] [PASSED] drm_test_bridge_rgb_yuv_no_path [14:22:33] =============== [PASSED] drm_bridge_bus_fmt ================ [14:22:33] ============= drm_cmdline_parser (40 subtests) ============= [14:22:33] [PASSED] drm_test_cmdline_force_d_only [14:22:33] [PASSED] drm_test_cmdline_force_D_only_dvi [14:22:33] [PASSED] drm_test_cmdline_force_D_only_hdmi [14:22:33] [PASSED] drm_test_cmdline_force_D_only_not_digital [14:22:33] [PASSED] drm_test_cmdline_force_e_only [14:22:33] [PASSED] drm_test_cmdline_res [14:22:33] [PASSED] drm_test_cmdline_res_vesa [14:22:33] [PASSED] drm_test_cmdline_res_vesa_rblank [14:22:33] [PASSED] drm_test_cmdline_res_rblank [14:22:33] [PASSED] drm_test_cmdline_res_bpp [14:22:33] [PASSED] drm_test_cmdline_res_refresh [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh_margins [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital [14:22:33] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on [14:22:33] [PASSED] drm_test_cmdline_res_margins_force_on [14:22:33] [PASSED] drm_test_cmdline_res_vesa_margins [14:22:33] [PASSED] drm_test_cmdline_name [14:22:33] [PASSED] drm_test_cmdline_name_bpp [14:22:33] [PASSED] drm_test_cmdline_name_option [14:22:33] [PASSED] drm_test_cmdline_name_bpp_option [14:22:33] [PASSED] drm_test_cmdline_rotate_0 [14:22:33] [PASSED] drm_test_cmdline_rotate_90 [14:22:33] [PASSED] drm_test_cmdline_rotate_180 [14:22:33] [PASSED] drm_test_cmdline_rotate_270 [14:22:33] [PASSED] drm_test_cmdline_hmirror [14:22:33] [PASSED] drm_test_cmdline_vmirror [14:22:33] [PASSED] drm_test_cmdline_margin_options [14:22:33] [PASSED] drm_test_cmdline_multiple_options [14:22:33] [PASSED] drm_test_cmdline_bpp_extra_and_option [14:22:33] [PASSED] drm_test_cmdline_extra_and_option [14:22:33] [PASSED] drm_test_cmdline_freestanding_options [14:22:33] [PASSED] drm_test_cmdline_freestanding_force_e_and_options [14:22:33] [PASSED] drm_test_cmdline_panel_orientation [14:22:33] ================ drm_test_cmdline_invalid ================= [14:22:33] [PASSED] margin_only [14:22:33] [PASSED] interlace_only [14:22:33] [PASSED] res_missing_x [14:22:33] [PASSED] res_missing_y [14:22:33] [PASSED] res_bad_y [14:22:33] [PASSED] res_missing_y_bpp [14:22:33] [PASSED] res_bad_bpp [14:22:33] [PASSED] res_bad_refresh [14:22:33] [PASSED] res_bpp_refresh_force_on_off [14:22:33] [PASSED] res_invalid_mode [14:22:33] [PASSED] res_bpp_wrong_place_mode [14:22:33] [PASSED] name_bpp_refresh [14:22:33] [PASSED] name_refresh [14:22:33] [PASSED] name_refresh_wrong_mode [14:22:33] [PASSED] name_refresh_invalid_mode [14:22:33] [PASSED] rotate_multiple [14:22:33] [PASSED] rotate_invalid_val [14:22:33] [PASSED] rotate_truncated [14:22:33] [PASSED] invalid_option [14:22:33] [PASSED] invalid_tv_option [14:22:33] [PASSED] truncated_tv_option [14:22:33] ============ [PASSED] drm_test_cmdline_invalid ============= [14:22:33] =============== drm_test_cmdline_tv_options =============== [14:22:33] [PASSED] NTSC [14:22:33] [PASSED] NTSC_443 [14:22:33] [PASSED] NTSC_J [14:22:33] [PASSED] PAL [14:22:33] [PASSED] PAL_M [14:22:33] [PASSED] PAL_N [14:22:33] [PASSED] SECAM [14:22:33] [PASSED] MONO_525 [14:22:33] [PASSED] MONO_625 [14:22:33] =========== [PASSED] drm_test_cmdline_tv_options =========== [14:22:33] =============== [PASSED] drm_cmdline_parser ================ [14:22:33] ========== drmm_connector_hdmi_init (20 subtests) ========== [14:22:33] [PASSED] drm_test_connector_hdmi_init_valid [14:22:33] [PASSED] drm_test_connector_hdmi_init_bpc_8 [14:22:33] [PASSED] drm_test_connector_hdmi_init_bpc_10 [14:22:33] [PASSED] drm_test_connector_hdmi_init_bpc_12 [14:22:33] [PASSED] drm_test_connector_hdmi_init_bpc_invalid [14:22:33] [PASSED] drm_test_connector_hdmi_init_bpc_null [14:22:33] [PASSED] drm_test_connector_hdmi_init_formats_empty [14:22:33] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb [14:22:33] === drm_test_connector_hdmi_init_formats_yuv420_allowed === [14:22:33] [PASSED] supported_formats=0x9 yuv420_allowed=1 [14:22:33] [PASSED] supported_formats=0x9 yuv420_allowed=0 [14:22:33] [PASSED] supported_formats=0x5 yuv420_allowed=1 [14:22:33] [PASSED] supported_formats=0x5 yuv420_allowed=0 [14:22:33] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed === [14:22:33] [PASSED] drm_test_connector_hdmi_init_null_ddc [14:22:33] [PASSED] drm_test_connector_hdmi_init_null_product [14:22:33] [PASSED] drm_test_connector_hdmi_init_null_vendor [14:22:33] [PASSED] drm_test_connector_hdmi_init_product_length_exact [14:22:33] [PASSED] drm_test_connector_hdmi_init_product_length_too_long [14:22:33] [PASSED] drm_test_connector_hdmi_init_product_valid [14:22:33] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact [14:22:33] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long [14:22:33] [PASSED] drm_test_connector_hdmi_init_vendor_valid [14:22:33] ========= drm_test_connector_hdmi_init_type_valid ========= [14:22:33] [PASSED] HDMI-A [14:22:33] [PASSED] HDMI-B [14:22:33] ===== [PASSED] drm_test_connector_hdmi_init_type_valid ===== [14:22:33] ======== drm_test_connector_hdmi_init_type_invalid ======== [14:22:33] [PASSED] Unknown [14:22:33] [PASSED] VGA [14:22:33] [PASSED] DVI-I [14:22:33] [PASSED] DVI-D [14:22:33] [PASSED] DVI-A [14:22:33] [PASSED] Composite [14:22:33] [PASSED] SVIDEO [14:22:33] [PASSED] LVDS [14:22:33] [PASSED] Component [14:22:33] [PASSED] DIN [14:22:33] [PASSED] DP [14:22:33] [PASSED] TV [14:22:33] [PASSED] eDP [14:22:33] [PASSED] Virtual [14:22:33] [PASSED] DSI [14:22:33] [PASSED] DPI [14:22:33] [PASSED] Writeback [14:22:33] [PASSED] SPI [14:22:33] [PASSED] USB [14:22:33] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ==== [14:22:33] ============ [PASSED] drmm_connector_hdmi_init ============= [14:22:33] ============= drmm_connector_init (3 subtests) ============= [14:22:33] [PASSED] drm_test_drmm_connector_init [14:22:33] [PASSED] drm_test_drmm_connector_init_null_ddc [14:22:33] ========= drm_test_drmm_connector_init_type_valid ========= [14:22:33] [PASSED] Unknown [14:22:33] [PASSED] VGA [14:22:33] [PASSED] DVI-I [14:22:33] [PASSED] DVI-D [14:22:33] [PASSED] DVI-A [14:22:33] [PASSED] Composite [14:22:33] [PASSED] SVIDEO [14:22:33] [PASSED] LVDS [14:22:33] [PASSED] Component [14:22:33] [PASSED] DIN [14:22:33] [PASSED] DP [14:22:33] [PASSED] HDMI-A [14:22:33] [PASSED] HDMI-B [14:22:33] [PASSED] TV [14:22:33] [PASSED] eDP [14:22:33] [PASSED] Virtual [14:22:33] [PASSED] DSI [14:22:33] [PASSED] DPI [14:22:33] [PASSED] Writeback [14:22:33] [PASSED] SPI [14:22:33] [PASSED] USB [14:22:33] ===== [PASSED] drm_test_drmm_connector_init_type_valid ===== [14:22:33] =============== [PASSED] drmm_connector_init =============== [14:22:33] ========= drm_connector_dynamic_init (6 subtests) ========== [14:22:33] [PASSED] drm_test_drm_connector_dynamic_init [14:22:33] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc [14:22:33] [PASSED] drm_test_drm_connector_dynamic_init_not_added [14:22:33] [PASSED] drm_test_drm_connector_dynamic_init_properties [14:22:33] ===== drm_test_drm_connector_dynamic_init_type_valid ====== [14:22:33] [PASSED] Unknown [14:22:33] [PASSED] VGA [14:22:33] [PASSED] DVI-I [14:22:33] [PASSED] DVI-D [14:22:33] [PASSED] DVI-A [14:22:33] [PASSED] Composite [14:22:33] [PASSED] SVIDEO [14:22:33] [PASSED] LVDS [14:22:33] [PASSED] Component [14:22:33] [PASSED] DIN [14:22:33] [PASSED] DP [14:22:33] [PASSED] HDMI-A [14:22:33] [PASSED] HDMI-B [14:22:33] [PASSED] TV [14:22:33] [PASSED] eDP [14:22:33] [PASSED] Virtual [14:22:33] [PASSED] DSI [14:22:33] [PASSED] DPI [14:22:33] [PASSED] Writeback [14:22:33] [PASSED] SPI [14:22:33] [PASSED] USB [14:22:33] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid == [14:22:33] ======== drm_test_drm_connector_dynamic_init_name ========= [14:22:33] [PASSED] Unknown [14:22:33] [PASSED] VGA [14:22:33] [PASSED] DVI-I [14:22:33] [PASSED] DVI-D [14:22:33] [PASSED] DVI-A [14:22:33] [PASSED] Composite [14:22:33] [PASSED] SVIDEO [14:22:33] [PASSED] LVDS [14:22:33] [PASSED] Component [14:22:33] [PASSED] DIN [14:22:33] [PASSED] DP [14:22:33] [PASSED] HDMI-A [14:22:33] [PASSED] HDMI-B [14:22:33] [PASSED] TV [14:22:33] [PASSED] eDP [14:22:33] [PASSED] Virtual [14:22:33] [PASSED] DSI [14:22:33] [PASSED] DPI [14:22:33] [PASSED] Writeback [14:22:33] [PASSED] SPI [14:22:33] [PASSED] USB [14:22:33] ==== [PASSED] drm_test_drm_connector_dynamic_init_name ===== [14:22:33] =========== [PASSED] drm_connector_dynamic_init ============ [14:22:33] ==== drm_connector_dynamic_register_early (4 subtests) ===== [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_early_defer [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object [14:22:33] ====== [PASSED] drm_connector_dynamic_register_early ======= [14:22:33] ======= drm_connector_dynamic_register (7 subtests) ======== [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_on_list [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_no_defer [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_no_init [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_mode_object [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_sysfs [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name [14:22:33] [PASSED] drm_test_drm_connector_dynamic_register_debugfs [14:22:33] ========= [PASSED] drm_connector_dynamic_register ========== [14:22:33] = drm_connector_attach_broadcast_rgb_property (2 subtests) = [14:22:33] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property [14:22:33] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector [14:22:33] === [PASSED] drm_connector_attach_broadcast_rgb_property === [14:22:33] ========== drm_get_tv_mode_from_name (2 subtests) ========== [14:22:33] ========== drm_test_get_tv_mode_from_name_valid =========== [14:22:33] [PASSED] NTSC [14:22:33] [PASSED] NTSC-443 [14:22:33] [PASSED] NTSC-J [14:22:33] [PASSED] PAL [14:22:33] [PASSED] PAL-M [14:22:33] [PASSED] PAL-N [14:22:33] [PASSED] SECAM [14:22:33] [PASSED] Mono [14:22:33] ====== [PASSED] drm_test_get_tv_mode_from_name_valid ======= [14:22:33] [PASSED] drm_test_get_tv_mode_from_name_truncated [14:22:33] ============ [PASSED] drm_get_tv_mode_from_name ============ [14:22:33] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) = [14:22:33] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb [14:22:33] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc [14:22:33] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1 [14:22:33] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc [14:22:33] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1 [14:22:33] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double [14:22:33] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid = [14:22:33] [PASSED] VIC 96 [14:22:33] [PASSED] VIC 97 [14:22:33] [PASSED] VIC 101 [14:22:33] [PASSED] VIC 102 [14:22:33] [PASSED] VIC 106 [14:22:33] [PASSED] VIC 107 [14:22:33] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid === [14:22:33] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc [14:22:33] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc [14:22:33] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc [14:22:33] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc [14:22:33] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc [14:22:33] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ==== [14:22:33] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) == [14:22:33] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name ==== [14:22:33] [PASSED] Automatic [14:22:33] [PASSED] Full [14:22:33] [PASSED] Limited 16:235 [14:22:33] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name === [14:22:33] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid [14:22:33] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ==== [14:22:33] == drm_hdmi_connector_get_output_format_name (2 subtests) == [14:22:33] === drm_test_drm_hdmi_connector_get_output_format_name ==== [14:22:33] [PASSED] RGB [14:22:33] [PASSED] YUV 4:2:0 [14:22:33] [PASSED] YUV 4:2:2 [14:22:33] [PASSED] YUV 4:4:4 [14:22:33] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name === [14:22:33] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid [14:22:33] ==== [PASSED] drm_hdmi_connector_get_output_format_name ==== [14:22:33] ============= drm_damage_helper (21 subtests) ============== [14:22:33] [PASSED] drm_test_damage_iter_no_damage [14:22:33] [PASSED] drm_test_damage_iter_no_damage_fractional_src [14:22:33] [PASSED] drm_test_damage_iter_no_damage_src_moved [14:22:33] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved [14:22:33] [PASSED] drm_test_damage_iter_no_damage_not_visible [14:22:33] [PASSED] drm_test_damage_iter_no_damage_no_crtc [14:22:33] [PASSED] drm_test_damage_iter_no_damage_no_fb [14:22:33] [PASSED] drm_test_damage_iter_simple_damage [14:22:33] [PASSED] drm_test_damage_iter_single_damage [14:22:33] [PASSED] drm_test_damage_iter_single_damage_intersect_src [14:22:33] [PASSED] drm_test_damage_iter_single_damage_outside_src [14:22:33] [PASSED] drm_test_damage_iter_single_damage_fractional_src [14:22:33] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src [14:22:33] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src [14:22:33] [PASSED] drm_test_damage_iter_single_damage_src_moved [14:22:33] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved [14:22:33] [PASSED] drm_test_damage_iter_damage [14:22:33] [PASSED] drm_test_damage_iter_damage_one_intersect [14:22:33] [PASSED] drm_test_damage_iter_damage_one_outside [14:22:33] [PASSED] drm_test_damage_iter_damage_src_moved [14:22:33] [PASSED] drm_test_damage_iter_damage_not_visible [14:22:33] ================ [PASSED] drm_damage_helper ================ [14:22:33] ============== drm_dp_mst_helper (3 subtests) ============== [14:22:33] ============== drm_test_dp_mst_calc_pbn_mode ============== [14:22:33] [PASSED] Clock 154000 BPP 30 DSC disabled [14:22:33] [PASSED] Clock 234000 BPP 30 DSC disabled [14:22:33] [PASSED] Clock 297000 BPP 24 DSC disabled [14:22:33] [PASSED] Clock 332880 BPP 24 DSC enabled [14:22:33] [PASSED] Clock 324540 BPP 24 DSC enabled [14:22:33] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ========== [14:22:33] ============== drm_test_dp_mst_calc_pbn_div =============== [14:22:33] [PASSED] Link rate 2000000 lane count 4 [14:22:33] [PASSED] Link rate 2000000 lane count 2 [14:22:33] [PASSED] Link rate 2000000 lane count 1 [14:22:33] [PASSED] Link rate 1350000 lane count 4 [14:22:33] [PASSED] Link rate 1350000 lane count 2 [14:22:33] [PASSED] Link rate 1350000 lane count 1 [14:22:33] [PASSED] Link rate 1000000 lane count 4 [14:22:33] [PASSED] Link rate 1000000 lane count 2 [14:22:33] [PASSED] Link rate 1000000 lane count 1 [14:22:33] [PASSED] Link rate 810000 lane count 4 [14:22:33] [PASSED] Link rate 810000 lane count 2 [14:22:33] [PASSED] Link rate 810000 lane count 1 [14:22:33] [PASSED] Link rate 540000 lane count 4 [14:22:33] [PASSED] Link rate 540000 lane count 2 [14:22:33] [PASSED] Link rate 540000 lane count 1 [14:22:33] [PASSED] Link rate 270000 lane count 4 [14:22:33] [PASSED] Link rate 270000 lane count 2 [14:22:33] [PASSED] Link rate 270000 lane count 1 [14:22:33] [PASSED] Link rate 162000 lane count 4 [14:22:33] [PASSED] Link rate 162000 lane count 2 [14:22:33] [PASSED] Link rate 162000 lane count 1 [14:22:33] ========== [PASSED] drm_test_dp_mst_calc_pbn_div =========== [14:22:33] ========= drm_test_dp_mst_sideband_msg_req_decode ========= [14:22:33] [PASSED] DP_ENUM_PATH_RESOURCES with port number [14:22:33] [PASSED] DP_POWER_UP_PHY with port number [14:22:33] [PASSED] DP_POWER_DOWN_PHY with port number [14:22:33] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks [14:22:33] [PASSED] DP_ALLOCATE_PAYLOAD with port number [14:22:33] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI [14:22:33] [PASSED] DP_ALLOCATE_PAYLOAD with PBN [14:22:33] [PASSED] DP_QUERY_PAYLOAD with port number [14:22:33] [PASSED] DP_QUERY_PAYLOAD with VCPI [14:22:33] [PASSED] DP_REMOTE_DPCD_READ with port number [14:22:33] [PASSED] DP_REMOTE_DPCD_READ with DPCD address [14:22:33] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes [14:22:33] [PASSED] DP_REMOTE_DPCD_WRITE with port number [14:22:33] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address [14:22:33] [PASSED] DP_REMOTE_DPCD_WRITE with data array [14:22:33] [PASSED] DP_REMOTE_I2C_READ with port number [14:22:33] [PASSED] DP_REMOTE_I2C_READ with I2C device ID [14:22:33] [PASSED] DP_REMOTE_I2C_READ with transactions array [14:22:33] [PASSED] DP_REMOTE_I2C_WRITE with port number [14:22:33] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID [14:22:33] [PASSED] DP_REMOTE_I2C_WRITE with data array [14:22:33] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID [14:22:33] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID [14:22:33] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event [14:22:33] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event [14:22:33] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior [14:22:33] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior [14:22:33] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode ===== [14:22:33] ================ [PASSED] drm_dp_mst_helper ================ [14:22:33] ================== drm_exec (7 subtests) =================== [14:22:33] [PASSED] sanitycheck [14:22:33] [PASSED] test_lock [14:22:33] [PASSED] test_lock_unlock [14:22:33] [PASSED] test_duplicates [14:22:33] [PASSED] test_prepare [14:22:33] [PASSED] test_prepare_array [14:22:33] [PASSED] test_multiple_loops [14:22:33] ==================== [PASSED] drm_exec ===================== [14:22:33] =========== drm_format_helper_test (17 subtests) =========== [14:22:33] ============== drm_test_fb_xrgb8888_to_gray8 ============== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ========== [14:22:33] ============= drm_test_fb_xrgb8888_to_rgb332 ============== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ========== [14:22:33] ============= drm_test_fb_xrgb8888_to_rgb565 ============== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ========== [14:22:33] ============ drm_test_fb_xrgb8888_to_xrgb1555 ============= [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 ========= [14:22:33] ============ drm_test_fb_xrgb8888_to_argb1555 ============= [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 ========= [14:22:33] ============ drm_test_fb_xrgb8888_to_rgba5551 ============= [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 ========= [14:22:33] ============= drm_test_fb_xrgb8888_to_rgb888 ============== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ========== [14:22:33] ============= drm_test_fb_xrgb8888_to_bgr888 ============== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ========== [14:22:33] ============ drm_test_fb_xrgb8888_to_argb8888 ============= [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 ========= [14:22:33] =========== drm_test_fb_xrgb8888_to_xrgb2101010 =========== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 ======= [14:22:33] =========== drm_test_fb_xrgb8888_to_argb2101010 =========== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 ======= [14:22:33] ============== drm_test_fb_xrgb8888_to_mono =============== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ========== [PASSED] drm_test_fb_xrgb8888_to_mono =========== [14:22:33] ==================== drm_test_fb_swab ===================== [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ================ [PASSED] drm_test_fb_swab ================= [14:22:33] ============ drm_test_fb_xrgb8888_to_xbgr8888 ============= [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 ========= [14:22:33] ============ drm_test_fb_xrgb8888_to_abgr8888 ============= [14:22:33] [PASSED] single_pixel_source_buffer [14:22:33] [PASSED] single_pixel_clip_rectangle [14:22:33] [PASSED] well_known_colors [14:22:33] [PASSED] destination_pitch [14:22:33] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 ========= [14:22:33] ================= drm_test_fb_clip_offset ================= [14:22:33] [PASSED] pass through [14:22:33] [PASSED] horizontal offset [14:22:33] [PASSED] vertical offset [14:22:33] [PASSED] horizontal and vertical offset [14:22:33] [PASSED] horizontal offset (custom pitch) [14:22:33] [PASSED] vertical offset (custom pitch) [14:22:33] [PASSED] horizontal and vertical offset (custom pitch) [14:22:33] ============= [PASSED] drm_test_fb_clip_offset ============= [14:22:33] =================== drm_test_fb_memcpy ==================== [14:22:33] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258) [14:22:33] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258) [14:22:33] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559) [14:22:33] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258) [14:22:33] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258) [14:22:33] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559) [14:22:33] [PASSED] well_known_colors: XB24 little-endian (0x34324258) [14:22:33] [PASSED] well_known_colors: XRA8 little-endian (0x38415258) [14:22:33] [PASSED] well_known_colors: YU24 little-endian (0x34325559) [14:22:33] [PASSED] destination_pitch: XB24 little-endian (0x34324258) [14:22:33] [PASSED] destination_pitch: XRA8 little-endian (0x38415258) [14:22:33] [PASSED] destination_pitch: YU24 little-endian (0x34325559) [14:22:33] =============== [PASSED] drm_test_fb_memcpy ================ [14:22:33] ============= [PASSED] drm_format_helper_test ============== [14:22:33] ================= drm_format (18 subtests) ================= [14:22:33] [PASSED] drm_test_format_block_width_invalid [14:22:33] [PASSED] drm_test_format_block_width_one_plane [14:22:33] [PASSED] drm_test_format_block_width_two_plane [14:22:33] [PASSED] drm_test_format_block_width_three_plane [14:22:33] [PASSED] drm_test_format_block_width_tiled [14:22:33] [PASSED] drm_test_format_block_height_invalid [14:22:33] [PASSED] drm_test_format_block_height_one_plane [14:22:33] [PASSED] drm_test_format_block_height_two_plane [14:22:33] [PASSED] drm_test_format_block_height_three_plane [14:22:33] [PASSED] drm_test_format_block_height_tiled [14:22:33] [PASSED] drm_test_format_min_pitch_invalid [14:22:33] [PASSED] drm_test_format_min_pitch_one_plane_8bpp [14:22:33] [PASSED] drm_test_format_min_pitch_one_plane_16bpp [14:22:33] [PASSED] drm_test_format_min_pitch_one_plane_24bpp [14:22:33] [PASSED] drm_test_format_min_pitch_one_plane_32bpp [14:22:33] [PASSED] drm_test_format_min_pitch_two_plane [14:22:33] [PASSED] drm_test_format_min_pitch_three_plane_8bpp [14:22:33] [PASSED] drm_test_format_min_pitch_tiled [14:22:33] =================== [PASSED] drm_format ==================== [14:22:33] ============== drm_framebuffer (10 subtests) =============== [14:22:33] ========== drm_test_framebuffer_check_src_coords ========== [14:22:33] [PASSED] Success: source fits into fb [14:22:33] [PASSED] Fail: overflowing fb with x-axis coordinate [14:22:33] [PASSED] Fail: overflowing fb with y-axis coordinate [14:22:33] [PASSED] Fail: overflowing fb with source width [14:22:33] [PASSED] Fail: overflowing fb with source height [14:22:33] ====== [PASSED] drm_test_framebuffer_check_src_coords ====== [14:22:33] [PASSED] drm_test_framebuffer_cleanup [14:22:33] =============== drm_test_framebuffer_create =============== [14:22:33] [PASSED] ABGR8888 normal sizes [14:22:33] [PASSED] ABGR8888 max sizes [14:22:33] [PASSED] ABGR8888 pitch greater than min required [14:22:33] [PASSED] ABGR8888 pitch less than min required [14:22:33] [PASSED] ABGR8888 Invalid width [14:22:33] [PASSED] ABGR8888 Invalid buffer handle [14:22:33] [PASSED] No pixel format [14:22:33] [PASSED] ABGR8888 Width 0 [14:22:33] [PASSED] ABGR8888 Height 0 [14:22:33] [PASSED] ABGR8888 Out of bound height * pitch combination [14:22:33] [PASSED] ABGR8888 Large buffer offset [14:22:33] [PASSED] ABGR8888 Buffer offset for inexistent plane [14:22:33] [PASSED] ABGR8888 Invalid flag [14:22:33] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers [14:22:33] [PASSED] ABGR8888 Valid buffer modifier [14:22:33] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE) [14:22:33] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS [14:22:33] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS [14:22:33] [PASSED] NV12 Normal sizes [14:22:33] [PASSED] NV12 Max sizes [14:22:33] [PASSED] NV12 Invalid pitch [14:22:33] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag [14:22:33] [PASSED] NV12 different modifier per-plane [14:22:33] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE [14:22:33] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS [14:22:33] [PASSED] NV12 Modifier for inexistent plane [14:22:33] [PASSED] NV12 Handle for inexistent plane [14:22:33] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS [14:22:33] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier [14:22:33] [PASSED] YVU420 Normal sizes [14:22:33] [PASSED] YVU420 Max sizes [14:22:33] [PASSED] YVU420 Invalid pitch [14:22:33] [PASSED] YVU420 Different pitches [14:22:33] [PASSED] YVU420 Different buffer offsets/pitches [14:22:33] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS [14:22:33] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS [14:22:33] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS [14:22:33] [PASSED] YVU420 Valid modifier [14:22:33] [PASSED] YVU420 Different modifiers per plane [14:22:33] [PASSED] YVU420 Modifier for inexistent plane [14:22:33] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR) [14:22:33] [PASSED] X0L2 Normal sizes [14:22:33] [PASSED] X0L2 Max sizes [14:22:33] [PASSED] X0L2 Invalid pitch [14:22:33] [PASSED] X0L2 Pitch greater than minimum required [14:22:33] [PASSED] X0L2 Handle for inexistent plane [14:22:33] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set [14:22:33] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set [14:22:33] [PASSED] X0L2 Valid modifier [14:22:33] [PASSED] X0L2 Modifier for inexistent plane [14:22:33] =========== [PASSED] drm_test_framebuffer_create =========== [14:22:33] [PASSED] drm_test_framebuffer_free [14:22:33] [PASSED] drm_test_framebuffer_init [14:22:33] [PASSED] drm_test_framebuffer_init_bad_format [14:22:33] [PASSED] drm_test_framebuffer_init_dev_mismatch [14:22:33] [PASSED] drm_test_framebuffer_lookup [14:22:33] [PASSED] drm_test_framebuffer_lookup_inexistent [14:22:33] [PASSED] drm_test_framebuffer_modifiers_not_supported [14:22:33] ================= [PASSED] drm_framebuffer ================= [14:22:33] ================ drm_gem_shmem (8 subtests) ================ [14:22:33] [PASSED] drm_gem_shmem_test_obj_create [14:22:33] [PASSED] drm_gem_shmem_test_obj_create_private [14:22:33] [PASSED] drm_gem_shmem_test_pin_pages [14:22:33] [PASSED] drm_gem_shmem_test_vmap [14:22:33] [PASSED] drm_gem_shmem_test_get_sg_table [14:22:33] [PASSED] drm_gem_shmem_test_get_pages_sgt [14:22:33] [PASSED] drm_gem_shmem_test_madvise [14:22:33] [PASSED] drm_gem_shmem_test_purge [14:22:33] ================== [PASSED] drm_gem_shmem ================== [14:22:33] === drm_atomic_helper_connector_hdmi_check (29 subtests) === [14:22:33] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode [14:22:33] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1 [14:22:33] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode [14:22:33] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1 [14:22:33] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode [14:22:33] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1 [14:22:33] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420 ======= [14:22:33] [PASSED] Automatic [14:22:33] [PASSED] Full [14:22:33] [PASSED] Limited 16:235 [14:22:33] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 === [14:22:33] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed [14:22:33] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed [14:22:33] [PASSED] drm_test_check_disable_connector [14:22:33] [PASSED] drm_test_check_hdmi_funcs_reject_rate [14:22:33] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb [14:22:33] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420 [14:22:33] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422 [14:22:33] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420 [14:22:33] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420 [14:22:33] [PASSED] drm_test_check_output_bpc_crtc_mode_changed [14:22:33] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed [14:22:33] [PASSED] drm_test_check_output_bpc_dvi [14:22:33] [PASSED] drm_test_check_output_bpc_format_vic_1 [14:22:33] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only [14:22:33] [PASSED] drm_test_check_output_bpc_format_display_rgb_only [14:22:33] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only [14:22:33] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only [14:22:33] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc [14:22:33] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc [14:22:33] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc [14:22:33] ============ drm_test_check_hdmi_color_format ============= [14:22:33] [PASSED] AUTO -> RGB [14:22:33] [PASSED] YCBCR422 -> YUV422 [14:22:33] [PASSED] YCBCR420 -> YUV420 [14:22:33] [PASSED] YCBCR444 -> YUV444 [14:22:33] [PASSED] RGB -> RGB [14:22:33] ======== [PASSED] drm_test_check_hdmi_color_format ========= [14:22:33] ======== drm_test_check_hdmi_color_format_420_only ======== [14:22:33] [PASSED] RGB should fail [14:22:33] [PASSED] YUV444 should fail [14:22:33] [PASSED] YUV422 should fail [14:22:33] [PASSED] YUV420 should work [14:22:33] ==== [PASSED] drm_test_check_hdmi_color_format_420_only ==== [14:22:33] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ====== [14:22:33] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ==== [14:22:33] [PASSED] drm_test_check_broadcast_rgb_value [14:22:33] [PASSED] drm_test_check_bpc_8_value [14:22:33] [PASSED] drm_test_check_bpc_10_value [14:22:33] [PASSED] drm_test_check_bpc_12_value [14:22:33] [PASSED] drm_test_check_format_value [14:22:33] [PASSED] drm_test_check_tmds_char_value [14:22:33] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ====== [14:22:33] = drm_atomic_helper_connector_hdmi_mode_valid (7 subtests) = [14:22:33] [PASSED] drm_test_check_mode_valid [14:22:33] [PASSED] drm_test_check_mode_valid_reject [14:22:33] [PASSED] drm_test_check_mode_valid_reject_rate [14:22:33] [PASSED] drm_test_check_mode_valid_reject_max_clock [14:22:33] [PASSED] drm_test_check_mode_valid_yuv420_only_max_clock [14:22:33] [PASSED] drm_test_check_mode_valid_reject_yuv420_only_connector [14:22:33] [PASSED] drm_test_check_mode_valid_accept_yuv420_also_connector_rgb [14:22:33] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid === [14:22:33] = drm_atomic_helper_connector_hdmi_infoframes (5 subtests) = [14:22:33] [PASSED] drm_test_check_infoframes [14:22:33] [PASSED] drm_test_check_reject_avi_infoframe [14:22:33] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_8 [14:22:33] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_10 [14:22:33] [PASSED] drm_test_check_reject_audio_infoframe [14:22:33] === [PASSED] drm_atomic_helper_connector_hdmi_infoframes === [14:22:33] ================= drm_managed (2 subtests) ================= [14:22:33] [PASSED] drm_test_managed_release_action [14:22:33] [PASSED] drm_test_managed_run_action [14:22:33] =================== [PASSED] drm_managed =================== [14:22:33] =================== drm_mm (6 subtests) ==================== [14:22:33] [PASSED] drm_test_mm_init [14:22:33] [PASSED] drm_test_mm_debug [14:22:33] [PASSED] drm_test_mm_align32 [14:22:33] [PASSED] drm_test_mm_align64 [14:22:33] [PASSED] drm_test_mm_lowest [14:22:33] [PASSED] drm_test_mm_highest [14:22:33] ===================== [PASSED] drm_mm ====================== [14:22:33] ============= drm_modes_analog_tv (5 subtests) ============= [14:22:33] [PASSED] drm_test_modes_analog_tv_mono_576i [14:22:33] [PASSED] drm_test_modes_analog_tv_ntsc_480i [14:22:33] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined [14:22:33] [PASSED] drm_test_modes_analog_tv_pal_576i [14:22:33] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined [14:22:33] =============== [PASSED] drm_modes_analog_tv =============== [14:22:33] ============== drm_plane_helper (2 subtests) =============== [14:22:33] =============== drm_test_check_plane_state ================ [14:22:33] [PASSED] clipping_simple [14:22:33] [PASSED] clipping_rotate_reflect [14:22:33] [PASSED] positioning_simple [14:22:33] [PASSED] upscaling [14:22:33] [PASSED] downscaling [14:22:33] [PASSED] rounding1 [14:22:33] [PASSED] rounding2 [14:22:33] [PASSED] rounding3 [14:22:33] [PASSED] rounding4 [14:22:33] =========== [PASSED] drm_test_check_plane_state ============ [14:22:33] =========== drm_test_check_invalid_plane_state ============ [14:22:33] [PASSED] positioning_invalid [14:22:33] [PASSED] upscaling_invalid [14:22:33] [PASSED] downscaling_invalid [14:22:33] ======= [PASSED] drm_test_check_invalid_plane_state ======== [14:22:33] ================ [PASSED] drm_plane_helper ================= [14:22:33] ====== drm_connector_helper_tv_get_modes (1 subtest) ======= [14:22:33] ====== drm_test_connector_helper_tv_get_modes_check ======= [14:22:33] [PASSED] None [14:22:33] [PASSED] PAL [14:22:33] [PASSED] NTSC [14:22:33] [PASSED] Both, NTSC Default [14:22:33] [PASSED] Both, PAL Default [14:22:33] [PASSED] Both, NTSC Default, with PAL on command-line [14:22:33] [PASSED] Both, PAL Default, with NTSC on command-line [14:22:33] == [PASSED] drm_test_connector_helper_tv_get_modes_check === [14:22:33] ======== [PASSED] drm_connector_helper_tv_get_modes ======== [14:22:33] ================== drm_rect (9 subtests) =================== [14:22:33] [PASSED] drm_test_rect_clip_scaled_div_by_zero [14:22:33] [PASSED] drm_test_rect_clip_scaled_not_clipped [14:22:33] [PASSED] drm_test_rect_clip_scaled_clipped [14:22:33] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned [14:22:33] ================= drm_test_rect_intersect ================= [14:22:33] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0 [14:22:33] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1 [14:22:33] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0 [14:22:33] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1 [14:22:33] [PASSED] right x left: 2x1+0+0 x 3x1+1+0 [14:22:33] [PASSED] left x right: 3x1+1+0 x 2x1+0+0 [14:22:33] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1 [14:22:33] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0 [14:22:33] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1 [14:22:33] [PASSED] touching side: 1x1+0+0 x 1x1+1+0 [14:22:33] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0 [14:22:33] [PASSED] inside another: 2x2+0+0 x 1x1+1+1 [14:22:33] [PASSED] far away: 1x1+0+0 x 1x1+3+6 [14:22:33] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10 [14:22:33] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10 [14:22:33] ============= [PASSED] drm_test_rect_intersect ============= [14:22:33] ================ drm_test_rect_calc_hscale ================ [14:22:33] [PASSED] normal use [14:22:33] [PASSED] out of max range [14:22:33] [PASSED] out of min range [14:22:33] [PASSED] zero dst [14:22:33] [PASSED] negative src [14:22:33] [PASSED] negative dst [14:22:33] ============ [PASSED] drm_test_rect_calc_hscale ============ [14:22:33] ================ drm_test_rect_calc_vscale ================ [14:22:33] [PASSED] normal use [14:22:33] [PASSED] out of max range [14:22:33] [PASSED] out of min range [14:22:33] [PASSED] zero dst [14:22:33] [PASSED] negative src [14:22:33] [PASSED] negative dst [14:22:33] ============ [PASSED] drm_test_rect_calc_vscale ============ [14:22:33] ================== drm_test_rect_rotate =================== [14:22:33] [PASSED] reflect-x [14:22:33] [PASSED] reflect-y [14:22:33] [PASSED] rotate-0 [14:22:33] [PASSED] rotate-90 [14:22:33] [PASSED] rotate-180 [14:22:33] [PASSED] rotate-270 [14:22:33] ============== [PASSED] drm_test_rect_rotate =============== [14:22:33] ================ drm_test_rect_rotate_inv ================= [14:22:33] [PASSED] reflect-x [14:22:33] [PASSED] reflect-y [14:22:33] [PASSED] rotate-0 [14:22:33] [PASSED] rotate-90 [14:22:33] [PASSED] rotate-180 [14:22:33] [PASSED] rotate-270 [14:22:33] ============ [PASSED] drm_test_rect_rotate_inv ============= [14:22:33] ==================== [PASSED] drm_rect ===================== [14:22:33] ============ drm_sysfb_modeset_test (1 subtest) ============ [14:22:33] ============ drm_test_sysfb_build_fourcc_list ============= [14:22:33] [PASSED] no native formats [14:22:33] [PASSED] XRGB8888 as native format [14:22:33] [PASSED] remove duplicates [14:22:33] [PASSED] convert alpha formats [14:22:33] [PASSED] random formats [14:22:33] ======== [PASSED] drm_test_sysfb_build_fourcc_list ========= [14:22:33] ============= [PASSED] drm_sysfb_modeset_test ============== [14:22:33] ================== drm_fixp (2 subtests) =================== [14:22:33] [PASSED] drm_test_int2fixp [14:22:33] [PASSED] drm_test_sm2fixp [14:22:33] ==================== [PASSED] drm_fixp ===================== [14:22:33] ============================================================ [14:22:33] Testing complete. Ran 641 tests: passed: 641 [14:22:33] Elapsed time: 26.948s total, 1.821s configuring, 24.962s building, 0.140s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig [14:22:34] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [14:22:35] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [14:22:45] Starting KUnit Kernel (1/1)... [14:22:45] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [14:22:45] ============= refcount_interrupt (4 subtests) ============== [14:22:45] [PASSED] test_single_irq_change [14:22:45] [PASSED] test_nested_irq_change [14:22:45] [PASSED] test_multiple_irq_change [14:22:45] [PASSED] test_irq_save [14:22:45] =============== [PASSED] refcount_interrupt ================ [14:22:45] ================= ttm_device (5 subtests) ================== [14:22:45] [PASSED] ttm_device_init_basic [14:22:45] [PASSED] ttm_device_init_multiple [14:22:45] [PASSED] ttm_device_fini_basic [14:22:45] [PASSED] ttm_device_init_no_vma_man [14:22:45] ================== ttm_device_init_pools ================== [14:22:45] [PASSED] No DMA allocations, no DMA32 required [14:22:45] [PASSED] DMA allocations, DMA32 required [14:22:45] [PASSED] No DMA allocations, DMA32 required [14:22:45] [PASSED] DMA allocations, no DMA32 required [14:22:45] ============== [PASSED] ttm_device_init_pools ============== [14:22:45] =================== [PASSED] ttm_device ==================== [14:22:45] ================== ttm_pool (8 subtests) =================== [14:22:45] ================== ttm_pool_alloc_basic =================== [14:22:45] [PASSED] One page [14:22:45] [PASSED] More than one page [14:22:45] [PASSED] Above the allocation limit [14:22:45] [PASSED] One page, with coherent DMA mappings enabled [14:22:45] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [14:22:45] ============== [PASSED] ttm_pool_alloc_basic =============== [14:22:45] ============== ttm_pool_alloc_basic_dma_addr ============== [14:22:45] [PASSED] One page [14:22:45] [PASSED] More than one page [14:22:45] [PASSED] Above the allocation limit [14:22:45] [PASSED] One page, with coherent DMA mappings enabled [14:22:45] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [14:22:45] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ========== [14:22:45] [PASSED] ttm_pool_alloc_order_caching_match [14:22:45] [PASSED] ttm_pool_alloc_caching_mismatch [14:22:46] [PASSED] ttm_pool_alloc_order_mismatch [14:22:46] [PASSED] ttm_pool_free_dma_alloc [14:22:46] [PASSED] ttm_pool_free_no_dma_alloc [14:22:46] [PASSED] ttm_pool_fini_basic [14:22:46] ==================== [PASSED] ttm_pool ===================== [14:22:46] ================ ttm_resource (8 subtests) ================= [14:22:46] ================= ttm_resource_init_basic ================= [14:22:46] [PASSED] Init resource in TTM_PL_SYSTEM [14:22:46] [PASSED] Init resource in TTM_PL_VRAM [14:22:46] [PASSED] Init resource in a private placement [14:22:46] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags [14:22:46] ============= [PASSED] ttm_resource_init_basic ============= [14:22:46] [PASSED] ttm_resource_init_pinned [14:22:46] [PASSED] ttm_resource_fini_basic [14:22:46] [PASSED] ttm_resource_manager_init_basic [14:22:46] [PASSED] ttm_resource_manager_usage_basic [14:22:46] [PASSED] ttm_resource_manager_set_used_basic [14:22:46] [PASSED] ttm_sys_man_alloc_basic [14:22:46] [PASSED] ttm_sys_man_free_basic [14:22:46] ================== [PASSED] ttm_resource =================== [14:22:46] =================== ttm_tt (15 subtests) =================== [14:22:46] ==================== ttm_tt_init_basic ==================== [14:22:46] [PASSED] Page-aligned size [14:22:46] [PASSED] Extra pages requested [14:22:46] ================ [PASSED] ttm_tt_init_basic ================ [14:22:46] [PASSED] ttm_tt_init_misaligned [14:22:46] [PASSED] ttm_tt_fini_basic [14:22:46] [PASSED] ttm_tt_fini_sg [14:22:46] [PASSED] ttm_tt_fini_shmem [14:22:46] [PASSED] ttm_tt_create_basic [14:22:46] [PASSED] ttm_tt_create_invalid_bo_type [14:22:46] [PASSED] ttm_tt_create_ttm_exists [14:22:46] [PASSED] ttm_tt_create_failed [14:22:46] [PASSED] ttm_tt_destroy_basic [14:22:46] [PASSED] ttm_tt_populate_null_ttm [14:22:46] [PASSED] ttm_tt_populate_populated_ttm [14:22:46] [PASSED] ttm_tt_unpopulate_basic [14:22:46] [PASSED] ttm_tt_unpopulate_empty_ttm [14:22:46] [PASSED] ttm_tt_swapin_basic [14:22:46] ===================== [PASSED] ttm_tt ====================== [14:22:46] =================== ttm_bo (14 subtests) =================== [14:22:46] =========== ttm_bo_reserve_optimistic_no_ticket =========== [14:22:46] [PASSED] Cannot be interrupted and sleeps [14:22:46] [PASSED] Cannot be interrupted, locks straight away [14:22:46] [PASSED] Can be interrupted, sleeps [14:22:46] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket ======= [14:22:46] [PASSED] ttm_bo_reserve_locked_no_sleep [14:22:46] [PASSED] ttm_bo_reserve_no_wait_ticket [14:22:46] [PASSED] ttm_bo_reserve_double_resv [14:22:46] [PASSED] ttm_bo_reserve_interrupted [14:22:46] [PASSED] ttm_bo_reserve_deadlock [14:22:46] [PASSED] ttm_bo_unreserve_basic [14:22:46] [PASSED] ttm_bo_unreserve_pinned [14:22:46] [PASSED] ttm_bo_unreserve_bulk [14:22:46] [PASSED] ttm_bo_fini_basic [14:22:46] [PASSED] ttm_bo_fini_shared_resv [14:22:46] [PASSED] ttm_bo_pin_basic [14:22:46] [PASSED] ttm_bo_pin_unpin_resource [14:22:46] [PASSED] ttm_bo_multiple_pin_one_unpin [14:22:46] ===================== [PASSED] ttm_bo ====================== [14:22:46] ============== ttm_bo_validate (22 subtests) =============== [14:22:46] ============== ttm_bo_init_reserved_sys_man =============== [14:22:46] [PASSED] Buffer object for userspace [14:22:46] [PASSED] Kernel buffer object [14:22:46] [PASSED] Shared buffer object [14:22:46] ========== [PASSED] ttm_bo_init_reserved_sys_man =========== [14:22:46] ============== ttm_bo_init_reserved_mock_man ============== [14:22:46] [PASSED] Buffer object for userspace [14:22:46] [PASSED] Kernel buffer object [14:22:46] [PASSED] Shared buffer object [14:22:46] ========== [PASSED] ttm_bo_init_reserved_mock_man ========== [14:22:46] [PASSED] ttm_bo_init_reserved_resv [14:22:46] ================== ttm_bo_validate_basic ================== [14:22:46] [PASSED] Buffer object for userspace [14:22:46] [PASSED] Kernel buffer object [14:22:46] [PASSED] Shared buffer object [14:22:46] ============== [PASSED] ttm_bo_validate_basic ============== [14:22:46] [PASSED] ttm_bo_validate_invalid_placement [14:22:46] ============= ttm_bo_validate_same_placement ============== [14:22:46] [PASSED] System manager [14:22:46] [PASSED] VRAM manager [14:22:46] ========= [PASSED] ttm_bo_validate_same_placement ========== [14:22:46] [PASSED] ttm_bo_validate_failed_alloc [14:22:46] [PASSED] ttm_bo_validate_pinned [14:22:46] [PASSED] ttm_bo_validate_busy_placement [14:22:46] ================ ttm_bo_validate_multihop ================= [14:22:46] [PASSED] Buffer object for userspace [14:22:46] [PASSED] Kernel buffer object [14:22:46] [PASSED] Shared buffer object [14:22:46] ============ [PASSED] ttm_bo_validate_multihop ============= [14:22:46] ========== ttm_bo_validate_no_placement_signaled ========== [14:22:46] [PASSED] Buffer object in system domain, no page vector [14:22:46] [PASSED] Buffer object in system domain with an existing page vector [14:22:46] ====== [PASSED] ttm_bo_validate_no_placement_signaled ====== [14:22:46] ======== ttm_bo_validate_no_placement_not_signaled ======== [14:22:46] [PASSED] Buffer object for userspace [14:22:46] [PASSED] Kernel buffer object [14:22:46] [PASSED] Shared buffer object [14:22:46] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ==== [14:22:46] [PASSED] ttm_bo_validate_move_fence_signaled [14:22:46] ========= ttm_bo_validate_move_fence_not_signaled ========= [14:22:46] [PASSED] Waits for GPU [14:22:46] [PASSED] Tries to lock straight away [14:22:46] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled ===== [14:22:46] [PASSED] ttm_bo_validate_swapout [14:22:46] [PASSED] ttm_bo_validate_happy_evict [14:22:46] [PASSED] ttm_bo_validate_all_pinned_evict [14:22:46] [PASSED] ttm_bo_validate_allowed_only_evict [14:22:46] [PASSED] ttm_bo_validate_deleted_evict [14:22:46] [PASSED] ttm_bo_validate_busy_domain_evict [14:22:46] [PASSED] ttm_bo_validate_evict_gutting [14:22:46] [PASSED] ttm_bo_validate_recrusive_evict [14:22:46] ================= [PASSED] ttm_bo_validate ================= [14:22:46] ============================================================ [14:22:46] Testing complete. Ran 106 tests: passed: 106 [14:22:46] Elapsed time: 12.028s total, 1.838s configuring, 9.976s building, 0.180s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/dma-buf/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/dma-buf/.kunitconfig [14:22:46] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [14:22:48] Building KUnit Kernel ... Populating config with: $ make ARCH=um O=.kunit olddefconfig Building with: $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48 [14:22:56] Starting KUnit Kernel (1/1)... [14:22:56] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [14:22:56] ============= refcount_interrupt (4 subtests) ============== [14:22:56] [PASSED] test_single_irq_change [14:22:56] [PASSED] test_nested_irq_change [14:22:56] [PASSED] test_multiple_irq_change [14:22:56] [PASSED] test_irq_save [14:22:56] =============== [PASSED] refcount_interrupt ================ [14:22:56] =============== dma-buf-fence (12 subtests) ================ [14:22:56] [PASSED] test_sanitycheck [14:22:56] [PASSED] test_signaling [14:22:56] [PASSED] test_add_callback [14:22:56] [PASSED] test_late_add_callback [14:22:56] [PASSED] test_rm_callback [14:22:56] [PASSED] test_late_rm_callback [14:22:56] [PASSED] test_status [14:22:56] [PASSED] test_error [14:22:56] [PASSED] test_wait [14:22:56] [PASSED] test_wait_timeout [14:22:56] [PASSED] test_stub [14:22:56] [SKIPPED] test_race_signal_callback (requires at least 2 CPUs) [14:22:56] ================== [PASSED] dma-buf-fence ================== [14:22:56] ============ dma-buf-fence-chain (11 subtests) ============= [14:22:56] [PASSED] test_sanitycheck [14:22:56] [PASSED] test_find_seqno [14:22:56] [PASSED] test_find_signaled [14:22:56] [PASSED] test_find_out_of_order [14:23:01] [PASSED] test_find_gap [14:23:01] [PASSED] test_find_race [14:23:01] [PASSED] test_signal_forward [14:23:01] [PASSED] test_signal_backward [14:23:01] [PASSED] test_wait_forward [14:23:01] [PASSED] test_wait_backward [14:23:01] [PASSED] test_wait_random [14:23:01] =============== [PASSED] dma-buf-fence-chain =============== [14:23:01] ============ dma-buf-fence-unwrap (10 subtests) ============ [14:23:01] [PASSED] test_sanitycheck [14:23:01] [PASSED] test_unwrap_array [14:23:01] [PASSED] test_unwrap_chain [14:23:01] [PASSED] test_unwrap_chain_array [14:23:01] [PASSED] test_unwrap_merge [14:23:01] [PASSED] test_unwrap_merge_duplicate [14:23:01] [PASSED] test_unwrap_merge_seqno [14:23:01] [PASSED] test_unwrap_merge_order [14:23:01] [PASSED] test_unwrap_merge_complex [14:23:01] [PASSED] test_unwrap_merge_complex_seqno [14:23:01] ============== [PASSED] dma-buf-fence-unwrap =============== [14:23:01] ================ dma-buf-resv (5 subtests) ================= [14:23:01] [PASSED] test_sanitycheck [14:23:01] ===================== test_signaling ====================== [14:23:01] [PASSED] kernel [14:23:01] [PASSED] write [14:23:01] [PASSED] read [14:23:01] [PASSED] bookkeep [14:23:01] ================= [PASSED] test_signaling ================== [14:23:01] ====================== test_for_each ====================== [14:23:01] [PASSED] kernel [14:23:01] [PASSED] write [14:23:01] [PASSED] read [14:23:01] [PASSED] bookkeep [14:23:01] ================== [PASSED] test_for_each ================== [14:23:01] ================= test_for_each_unlocked ================== [14:23:01] [PASSED] kernel [14:23:01] [PASSED] write [14:23:01] [PASSED] read [14:23:01] [PASSED] bookkeep [14:23:01] ============= [PASSED] test_for_each_unlocked ============== [14:23:01] ===================== test_get_fences ===================== [14:23:01] [PASSED] kernel [14:23:01] [PASSED] write [14:23:01] [PASSED] read [14:23:01] [PASSED] bookkeep [14:23:01] ================= [PASSED] test_get_fences ================= [14:23:01] ================== [PASSED] dma-buf-resv =================== [14:23:01] ============================================================ [14:23:01] Testing complete. Ran 54 tests: passed: 53, skipped: 1 [14:23:01] Elapsed time: 15.660s total, 1.858s configuring, 8.531s building, 5.257s running
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
Kees Cook
maintainerQuoted 11 lines · Bill Wendling
strlcat()is deprecated: likestrcat(), 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'sstrcat()implementation itself), replacing each withsnprintf(),scnprintf(), or theseq_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:
- 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")
Signature · 1 line
Kees Cook