[PATCH 0/4] fortify: Use __builtin_dynamic_object_size() when available

From: Kees Cook
Date: Tue Sep 20 2022 - 15:22:20 EST


Hi,

This adjusts CONFIG_FORTIFY_SOURCE's coverage to include greater runtime
size checking from GCC and Clang's __builtin_dynamic_object_size(), which
the compilers can track either via code flow or from __alloc_size() hints.

Thanks,

-Kees

Kees Cook (4):
x86/entry: Work around Clang __bdos() bug
fortify: Explicitly check bounds are compile-time constants
fortify: Convert to struct vs member helpers
fortify: Use __builtin_dynamic_object_size() when available

arch/x86/xen/enlighten_pv.c | 3 +-
drivers/misc/lkdtm/heap.c | 1 +
include/linux/compiler_attributes.h | 5 ++
include/linux/fortify-string.h | 125 ++++++++++++++++------------
4 files changed, 81 insertions(+), 53 deletions(-)

--
2.34.1