All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] slab: Provide full coverage for __alloc_size attribute
@ 2022-11-18  3:51 Kees Cook
  2022-11-18  3:51 ` [PATCH v2 1/2] slab: Clean up SLOB vs kmalloc() definition Kees Cook
  2022-11-18  3:51 ` [PATCH v2 2/2] slab: Remove special-casing of const 0 size allocations Kees Cook
  0 siblings, 2 replies; 8+ messages in thread
From: Kees Cook @ 2022-11-18  3:51 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Kees Cook, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, Roman Gushchin, Hyeonggon Yoo,
	linux-kernel, linux-mm, linux-hardening

Hi,

These patches work around a deficiency in GCC (>=11) and Clang (<16)
where the __alloc_size attribute does not apply to inlines. :(
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96503

This manifests as reduced overflow detection coverage for many allocation
sites under CONFIG_FORTIFY_SOURCE=y, where the allocation size was not
actually being propagated to __builtin_dynamic_object_size(). The problem
was in two halves: the trace wrapper (now fixed in -next), and const-0
special-casing (covered here).

Thanks,

-Kees

v2:
- drop trace wrapper refactoring -- handled differently now (vbabka)
- drop kunit/fortify test patch since it depends on other changes
- rebase
v1: https://lore.kernel.org/all/20221101222520.never.109-kees@kernel.org

Kees Cook (2):
  slab: Clean up SLOB vs kmalloc() definition
  slab: Remove special-casing of const 0 size allocations

 include/linux/slab.h | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-21  9:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18  3:51 [PATCH v2 0/2] slab: Provide full coverage for __alloc_size attribute Kees Cook
2022-11-18  3:51 ` [PATCH v2 1/2] slab: Clean up SLOB vs kmalloc() definition Kees Cook
2022-11-18 11:29   ` Hyeonggon Yoo
2022-11-18  3:51 ` [PATCH v2 2/2] slab: Remove special-casing of const 0 size allocations Kees Cook
2022-11-18 11:34   ` Vlastimil Babka
2022-11-18 17:06     ` Kees Cook
2022-11-21  9:28       ` Vlastimil Babka
2022-11-18 11:36   ` Hyeonggon Yoo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.