diff options
author | Francis Laniel <laniel_francis@privacyrequired.com> | 2020-12-16 07:43:54 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-12-16 09:46:16 +0300 |
commit | febebaf366868a4204deb3955ef5dda17f676fc1 (patch) | |
tree | ecad89f7e968a84ea586af705e4404890bbb2a8b /drivers/misc/lkdtm/lkdtm.h | |
parent | 33e56a59e64dfb68778e5da0be13f0c47dc5d445 (diff) | |
download | linux-febebaf366868a4204deb3955ef5dda17f676fc1.tar.xz |
drivers/misc/lkdtm: add new file in LKDTM to test fortified strscpy
This new test ensures that fortified strscpy has the same behavior than
vanilla strscpy (e.g. returning -E2BIG when src content is truncated).
Finally, it generates a crash at runtime because there is a write overflow
in destination string.
Link: https://lkml.kernel.org/r/20201122162451.27551-5-laniel_francis@privacyrequired.com
Signed-off-by: Francis Laniel <laniel_francis@privacyrequired.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: Daniel Axtens <dja@axtens.net>
Cc: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/lkdtm/lkdtm.h')
-rw-r--r-- | drivers/misc/lkdtm/lkdtm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/lkdtm/lkdtm.h b/drivers/misc/lkdtm/lkdtm.h index 49e6b945feb7..138f06254b61 100644 --- a/drivers/misc/lkdtm/lkdtm.h +++ b/drivers/misc/lkdtm/lkdtm.h @@ -104,4 +104,7 @@ void lkdtm_STACKLEAK_ERASING(void); /* cfi.c */ void lkdtm_CFI_FORWARD_PROTO(void); +/* fortify.c */ +void lkdtm_FORTIFIED_STRSCPY(void); + #endif |