linux/drivers/input
Josh Poimboeuf 7501153750 objtool, Input: cyapa - Remove undefined behavior in cyapa_update_fw_store()
In cyapa_update_fw_store(), if 'count' is zero, the write to
fw_name[count-1] underflows the array.

Presumably that's not possible in normal operation, as its caller
sysfs_kf_write() already checks for zero.  Regardless it's a good idea
to check for the error explicitly and avoid undefined behavior.

Fixes the following warning with an UBSAN kernel:

  vmlinux.o: warning: objtool: .text.cyapa_update_fw_store: unexpected end of section

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/73ae0bb3c656735890d914b74c9d6bb40c25d3cd.1742852847.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202503171547.LlCTJLQL-lkp@intel.com/
History 2025-03-25 23:00:15 +01:00
..
gameport Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
joystick Input: xpad - rename QH controller to Legion Go S 2025-02-25 08:10:23 -08:00
keyboard Input: atkbd - map F23 key to support default copilot shortcut 2025-01-20 21:23:38 -08:00
misc Input updates for v6.14-rc6 2025-03-15 15:46:29 -10:00
mouse objtool, Input: cyapa - Remove undefined behavior in cyapa_update_fw_store() 2025-03-25 23:00:15 +01:00
rmi4 Input updates for v6.13-rc0 2024-11-25 10:31:39 -08:00
serio Input updates for v6.14-rc6 2025-03-15 15:46:29 -10:00
tablet Input updates for v6.13-rc0 2024-11-25 10:31:39 -08:00
tests Input updates for v6.11-rc0 2024-07-19 16:51:39 -07:00
touchscreen Input: goodix-berlin - fix vddio regulator references 2025-02-24 22:28:50 -08:00
apm-power.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
evdev.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
ff-core.c Input: ff-core - make use of __free() cleanup facility 2024-12-23 22:53:21 -08:00
ff-memless.c Input: ff-memless - make use of __free() cleanup facility 2024-12-23 22:53:45 -08:00
input-compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
input-compat.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
input-core-private.h Input: deactivate MT slots when inhibiting or suspending devices 2022-07-20 11:35:13 -07:00
input-leds.c Input: leds - change config symbol dependency for audio mute trigger 2024-03-03 14:46:06 -08:00
input-mt.c Input: mt - make use of __free() cleanup facility 2024-12-23 22:53:57 -08:00
input-poller.c Input: poller - convert locking to guard notation 2024-12-23 22:53:57 -08:00
input-poller.h Input: add support for polling to input devices 2019-08-20 12:04:07 -07:00
input.c Input: use guard notation in input core 2024-12-23 22:53:58 -08:00
joydev.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
Kconfig Input: remove evbug driver 2024-12-17 13:53:52 -08:00
Makefile Input: remove evbug driver 2024-12-17 13:53:52 -08:00
matrix-keymap.c Input: matrix-keymap - switch to using __free() cleanup facility 2024-08-29 10:59:30 -07:00
mousedev.c *: convert stream-like files -> stream_open, even if they use noop_llseek 2019-07-14 16:09:19 +03:00
sparse-keymap.c Input: Use fallthrough pseudo-keyword 2020-07-07 11:25:54 -07:00
touchscreen.c Input: touchscreen - avoid bitwise vs logical OR warning 2021-10-15 22:22:54 -07:00
vivaldi-fmap.c Input: add missing MODULE_DESCRIPTION() macros 2024-06-09 14:38:48 -07:00