aboutsummaryrefslogtreecommitdiff
path: root/lib/crypto
diff options
context:
space:
mode:
authorChristian Marangi <[email protected]>2023-10-07 15:10:42 +0200
committerLee Jones <[email protected]>2023-11-01 11:29:14 +0000
commit259e33cbb1712a7dd844fc9757661cc47cb0e39b (patch)
treea16e907bba7cdc5dc97709e2d098c7e8e6ab00ad /lib/crypto
parent0ebdb7210943eb345992bea9892adbd15a206193 (diff)
leds: trigger: netdev: Move size check in set_device_name
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: [email protected] Fixes: 28a6a2ef18ad ("leds: trigger: netdev: refactor code setting device name") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Christian Marangi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
Diffstat (limited to 'lib/crypto')
0 files changed, 0 insertions, 0 deletions