linux-stable/drivers/auxdisplay
Justin Stitt a952abcdaa auxdisplay: panel: Replace deprecated strncpy() with strtomem_pad()
`strncpy` is deprecated and as such we should prefer more robust and
less ambiguous interfaces.

In this case, all of `press_str`, `repeat_str` and `release_str` are
explicitly marked as nonstring:
|   struct {	/* valid when type == INPUT_TYPE_KBD */
|           char press_str[sizeof(void *) + sizeof(int)] __nonstring;
|           char repeat_str[sizeof(void *) + sizeof(int)] __nonstring;
|           char release_str[sizeof(void *) + sizeof(int)] __nonstring;
|   } kbd;

... which makes `strtomem_pad` a suitable replacement as it is
functionally the same whilst being more obvious about its behavior.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230911-strncpy-drivers-auxdisplay-panel-c-v1-1-b60bd0ae8552@google.com
Signed-off-by: Kees Cook <keescook@chromium.org>
2023-09-29 14:48:31 -07:00
..
Kconfig
Makefile
arm-charlcd.c
cfag12864b.c
cfag12864bfb.c auxdisplay: Remove flag FBINFO_FLAG_DEFAULT from fbdev drivers 2023-07-24 16:50:39 +02:00
charlcd.c
charlcd.h
hd44780.c
hd44780_common.c auxdisplay: hd44780: move cursor home after clear display command 2023-08-19 21:53:49 +02:00
hd44780_common.h
ht16k33.c auxdisplay: Remove flag FBINFO_FLAG_DEFAULT from fbdev drivers 2023-07-24 16:50:39 +02:00
img-ascii-lcd.c
ks0108.c
lcd2s.c auxdisplay: Switch i2c drivers back to use .probe() 2023-06-02 13:23:32 +02:00
line-display.c
line-display.h
panel.c auxdisplay: panel: Replace deprecated strncpy() with strtomem_pad() 2023-09-29 14:48:31 -07:00