fortify: Detect struct member overflows in memset() at compile-time
authorKees Cook <keescook@chromium.org>
Wed, 16 Jun 2021 21:42:23 +0000 (14:42 -0700)
committerKees Cook <keescook@chromium.org>
Mon, 14 Feb 2022 00:50:06 +0000 (16:50 -0800)
commit28e77cc1c0686621a4d416f599cee5ab369daa0a
treec58b0cfacdeab1d3f46cbd12f91ebcfb37a7ab56
parent938a000e3f9bead24ea753286b3e4d2423275c9e
fortify: Detect struct member overflows in memset() at compile-time

As done for memcpy(), also update memset() to use the same tightened
compile-time bounds checking under CONFIG_FORTIFY_SOURCE.

Signed-off-by: Kees Cook <keescook@chromium.org>
include/linux/fortify-string.h
lib/test_fortify/write_overflow_field-memset.c [new file with mode: 0644]