fortify: Improve buffer overflow reporting
Improve the reporting of buffer overflows under CONFIG_FORTIFY_SOURCE to help accelerate debugging efforts. The calculations are all just sitting in registers anyway, so pass them along to the function to be reported. For example, before: detected buffer overflow in memcpy and after: memcpy: detected buffer overflow: 4096 byte read of buffer size 1 Link: https://lore.kernel.org/r/20230407192717.636137-10-keescook@chromium.org Signed-off-by:Kees Cook <keescook@chromium.org>
Showing
- arch/arm/boot/compressed/misc.c 1 addition, 1 deletionarch/arm/boot/compressed/misc.c
- arch/arm/boot/compressed/misc.h 1 addition, 1 deletionarch/arm/boot/compressed/misc.h
- arch/x86/boot/compressed/misc.c 1 addition, 1 deletionarch/x86/boot/compressed/misc.c
- include/linux/fortify-string.h 30 additions, 26 deletionsinclude/linux/fortify-string.h
- lib/fortify_kunit.c 2 additions, 2 deletionslib/fortify_kunit.c
- lib/string_helpers.c 5 additions, 4 deletionslib/string_helpers.c
Please register or sign in to comment