OSDN Git Service

fortify: Fix dropped strcpy() compile-time write overflow check
authorKees Cook <keescook@chromium.org>
Mon, 2 Aug 2021 17:25:01 +0000 (10:25 -0700)
committerKees Cook <keescook@chromium.org>
Sat, 25 Sep 2021 15:20:50 +0000 (08:20 -0700)
commit072af0c638dc8a5c7db2edc4dddbd6d44bee3bdb
tree2e0f8ef59e7937825af731b9a26454230d9b5167
parenta52f8a59aef46b59753e583bf4b28fccb069ce64
fortify: Fix dropped strcpy() compile-time write overflow check

The implementation for intra-object overflow in str*-family functions
accidentally dropped compile-time write overflow checking in strcpy(),
leaving it entirely to run-time. Add back the intended check.

Fixes: 6a39e62abbaf ("lib: string.h: detect intra-object overflow in fortified string functions")
Cc: Daniel Axtens <dja@axtens.net>
Cc: Francis Laniel <laniel_francis@privacyrequired.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
include/linux/fortify-string.h