summaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorJustin Stitt <justinstitt@google.com>2023-09-11 23:51:04 +0300
committerKees Cook <keescook@chromium.org>2023-09-30 00:48:31 +0300
commita952abcdaa22116d940ca9cb9253caad1622ae93 (patch)
tree81c49059097990fc3d5ac07ed05e79229e01d6b7 /drivers/bus
parente0bbf92682ad1df36ef43104a036469ac0ab3a4a (diff)
downloadlinux-a952abcdaa22116d940ca9cb9253caad1622ae93.tar.xz
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>
Diffstat (limited to 'drivers/bus')
0 files changed, 0 insertions, 0 deletions