mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 17:49:03 +02:00
GCC 13.2 complains about array subscript 17 is above array bounds of
'char[16]' with IFNAMSIZ set to 16.
The warning is correct but this scenario is impossible.
set_device_name is called by device_name_store (store sysfs entry) and
netdev_trig_activate.
device_name_store already check if size is >= of IFNAMSIZ and return
-EINVAL. (making the warning scenario impossible)
netdev_trig_activate works on already defined interface, where the name
has already been checked and should already follow the condition of
strlen() < IFNAMSIZ.
Aside from the scenario being impossible, set_device_name can be
improved to both mute the warning and make the function safer.
To make it safer, move size check from device_name_store directly to
set_device_name and prevent any out of bounds scenario.
Cc: stable@vger.kernel.org
Fixes:
|
||
|---|---|---|
| .. | ||
| Kconfig | ||
| ledtrig-activity.c | ||
| ledtrig-audio.c | ||
| ledtrig-backlight.c | ||
| ledtrig-camera.c | ||
| ledtrig-cpu.c | ||
| ledtrig-default-on.c | ||
| ledtrig-disk.c | ||
| ledtrig-gpio.c | ||
| ledtrig-heartbeat.c | ||
| ledtrig-mtd.c | ||
| ledtrig-netdev.c | ||
| ledtrig-oneshot.c | ||
| ledtrig-panic.c | ||
| ledtrig-pattern.c | ||
| ledtrig-timer.c | ||
| ledtrig-transient.c | ||
| ledtrig-tty.c | ||
| Makefile | ||