linux-stable/include
Przemek Kitszel 26dd68d293 overflow: add DEFINE_FLEX() for on-stack allocs
Add DEFINE_FLEX() macro for on-stack allocations of structs with
flexible array member.

Expose __struct_size() macro outside of fortify-string.h, as it could be
used to read size of structs allocated by DEFINE_FLEX().
Move __member_size() alongside it.
-Kees

Using underlying array for on-stack storage lets us to declare
known-at-compile-time structures without kzalloc().

Actual usage for ice driver is in following patches of the series.

Missing __has_builtin() workaround is moved up to serve also assembly
compilation with m68k-linux-gcc, see [1].
Error was (note the .S file extension):
In file included from ../include/linux/linkage.h:5,
                 from ../arch/m68k/fpsp040/skeleton.S:40:
../include/linux/compiler_types.h:331:5: warning: "__has_builtin" is not defined, evaluates to 0 [-Wundef]
  331 | #if __has_builtin(__builtin_dynamic_object_size)
      |     ^~~~~~~~~~~~~
../include/linux/compiler_types.h:331:18: error: missing binary operator before token "("
  331 | #if __has_builtin(__builtin_dynamic_object_size)
      |                  ^

[1] https://lore.kernel.org/netdev/202308112122.OuF0YZqL-lkp@intel.com/
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://lore.kernel.org/r/20230912115937.1645707-2-przemyslaw.kitszel@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-10-03 12:17:10 -07:00
..
acpi
asm-generic ata changes for 6.6 2023-09-05 12:37:28 -07:00
clocksource
crypto
drm drm/tests: helpers: Avoid a driver uaf 2023-09-14 13:57:58 +02:00
dt-bindings
keys
kunit
kvm
linux overflow: add DEFINE_FLEX() for on-stack allocs 2023-10-03 12:17:10 -07:00
math-emu
media
memory
misc
net net: dsa: notify drivers of MAC address changes on user ports 2023-10-03 13:51:02 +02:00
pcmcia
ras
rdma
rv
scsi SCSI misc on 20230909 2023-09-09 12:01:33 -07:00
soc
sound
target
trace net: implement lockless SO_MAX_PACING_RATE 2023-10-01 19:09:54 +01:00
uapi net_sched: sch_fq: add fast path for mostly idle qdisc 2023-10-01 13:20:36 +01:00
ufs
vdso
video
xen arm/xen: remove lazy mode related definitions 2023-09-19 07:04:49 +02:00