]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fortify: Do not special-case 0-sized destinations
authorKees Cook <kees@kernel.org>
Wed, 19 Jun 2024 20:31:05 +0000 (13:31 -0700)
committerKees Cook <kees@kernel.org>
Wed, 19 Jun 2024 20:32:04 +0000 (13:32 -0700)
commit2003e483a81cc235e29f77da3f6b256cb4b348e7
treef271aeae5cf006dedb24065559b463e7ec405f2a
parentd6f635bcaca8d38dfa47ee20658705f9eff156b5
fortify: Do not special-case 0-sized destinations

All fake flexible arrays should have been removed now, so remove the
special casing that was avoiding checking them. If a destination claims
to be 0 sized, believe it. This is especially important for cases where
__counted_by is in use and may have a 0 element count.

Link: https://lore.kernel.org/r/20240619203105.work.747-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
include/linux/fortify-string.h
lib/fortify_kunit.c