summaryrefslogtreecommitdiffstats
path: root/security/Kconfig.hardening
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2022-08-08 11:48:21 +0200
committerGuenter Roeck <linux@roeck-us.net>2022-08-10 09:49:46 +0200
commit7aeef1548ac026c8bcb9ec223b672f81da340011 (patch)
tree92b64297e8031f5853af6f724c70bf141af9e13f /security/Kconfig.hardening
parentadd barriers to buffer_uptodate and set_buffer_uptodate (diff)
downloadlinux-7aeef1548ac026c8bcb9ec223b672f81da340011.tar.xz
linux-7aeef1548ac026c8bcb9ec223b672f81da340011.zip
hwmon: (lm90) Fix error return value from detect function
lm90_detect_nuvoton() is supposed to return NULL if it can not detect a chip, or a pointer to the chip name if it does. Under some circumstances it returns an error pointer instead. Some versions of gcc interpret an ERR_PTR as region of size 0 and generate an error message. In function ‘__fortify_strlen’, inlined from ‘strlcpy’ at ./include/linux/fortify-string.h:159:10, inlined from ‘lm90_detect’ at drivers/hwmon/lm90.c:2550:2: ./include/linux/fortify-string.h:50:33: error: ‘__builtin_strlen’ reading 1 or more bytes from a region of size 0 50 | #define __underlying_strlen __builtin_strlen | ^ ./include/linux/fortify-string.h:141:24: note: in expansion of macro ‘__underlying_strlen’ 141 | return __underlying_strlen(p); | ^~~~~~~~~~~~~~~~~~~ Returning NULL instead of ERR_PTR() fixes the problem. Fixes: c7cebce984a2 ("hwmon: (lm90) Rework detect function") Reported-by: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Tested-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'security/Kconfig.hardening')
0 files changed, 0 insertions, 0 deletions