diff options
| author | Kees Cook <keescook@chromium.org> | 2021-08-11 10:03:00 -0700 |
|---|---|---|
| committer | Kees Cook <keescook@chromium.org> | 2021-08-11 10:03:00 -0700 |
| commit | 4752984fc24104f399e70f99d48afa047d86a381 (patch) | |
| tree | 298a2dca19cd7ac9facafd72dee01929ce377e2f | |
| parent | 672b0d601b63bbd3fbc9f655e0e318609481b715 (diff) | |
| download | linux-4752984fc24104f399e70f99d48afa047d86a381.tar.gz | |
DEBUG find 0-element destinationskspp/memcpy/next-20210803/v2-devel
Signed-off-by: Kees Cook <keescook@chromium.org>
| -rw-r--r-- | include/linux/fortify-string.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h index 72db2f75d480e..fc48008d6d453 100644 --- a/include/linux/fortify-string.h +++ b/include/linux/fortify-string.h @@ -388,6 +388,9 @@ __FORTIFY_INLINE bool fortify_memcpy_chk(__kernel_size_t size, #define __fortify_memcpy_chk(p, q, size, p_size, q_size, \ p_size_field, q_size_field, op) ({ \ size_t __fortify_size = (size_t)(size); \ + WARN_ONCE(p_size_field == 0, \ + #op ": detected %s\n", \ + "0-element field \"" #p "\" at " __FILE__ ":" __stringify(__LINE__)); \ WARN_ONCE(fortify_memcpy_chk(__fortify_size, p_size, q_size, \ p_size_field, q_size_field, #op), \ #op ": detected field-spanning write (size %zu) of single %s (size %zu)\n", \ |
