linux/drivers/net/ethernet/sun
Ronan Marchal 4d8e0becfd net: niu: fix potential buffer overflow/truncation in irq names
Building with W=1 reports a -Wformat-truncation warning on
niu_set_irq_name(): the "%s:SYSERR" format could be truncated
because irq_name[] was one byte too small for the worst case
interface name length (IFNAMSIZ-1) plus the ":SYSERR" suffix.

Increase the irq_name buffer size to account for the suffix and
replace the remaining sprintf() calls in the same function with
snprintf() to avoid possible buffer overflows.

Tested:
- Built the kernel with W=1 and confirmed the warning is no longer reported.
- No NIU hardware was available for runtime testing.

Signed-off-by: Ronan Marchal <ronanmarchal29@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260803211149.10585-1-ronanmarchal29@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-07 16:41:01 -07:00
..
cassini.c net/sun: Fix multiple typos in comments 2026-06-03 19:19:59 -07:00
cassini.h net/sun: Fix multiple typos in comments 2026-06-03 19:19:59 -07:00
Kconfig
ldmvsw.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Makefile
niu.c net: niu: fix potential buffer overflow/truncation in irq names 2026-08-07 16:41:01 -07:00
niu.h net: niu: fix potential buffer overflow/truncation in irq names 2026-08-07 16:41:01 -07:00
sunbmac.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
sunbmac.h net/sun: Fix multiple typos in comments 2026-06-03 19:19:59 -07:00
sungem.c net: sungem: fix probe error cleanup 2026-06-24 19:26:35 -07:00
sungem.h net/sun: Fix multiple typos in comments 2026-06-03 19:19:59 -07:00
sunhme.c net/sun: Fix multiple typos in comments 2026-06-03 19:19:59 -07:00
sunhme.h
sunqe.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sunqe.h net: Fix typos 2025-07-25 10:29:07 -07:00
sunvnet_common.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
sunvnet_common.h
sunvnet.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00