twx-linux/include
Alexander Lobakin 23681bc4b5 stddef: make __struct_group() UAPI C++-friendly
[ Upstream commit 724c6ce38bbaeb4b3f109b0e066d6c0ecd15446c ]

For the most part of the C++ history, it couldn't have type
declarations inside anonymous unions for different reasons. At the
same time, __struct_group() relies on the latters, so when the @TAG
argument is not empty, C++ code doesn't want to build (even under
`extern "C"`):

../linux/include/uapi/linux/pkt_cls.h:25:24: error:
'struct tc_u32_sel::<unnamed union>::tc_u32_sel_hdr,' invalid;
an anonymous union may only have public non-static data members
[-fpermissive]

The safest way to fix this without trying to switch standards (which
is impossible in UAPI anyway) etc., is to disable tag declaration
for that language. This won't break anything since for now it's not
buildable at all.
Use a separate definition for __struct_group() when __cplusplus is
defined to mitigate the error, including the version from tools/.

Fixes: 50d7bd38c3aa ("stddef: Introduce struct_group() helper macro")
Reported-by: Christopher Ferris <cferris@google.com>
Closes: https://lore.kernel.org/linux-hardening/Z1HZpe3WE5As8UAz@google.com
Suggested-by: Kees Cook <kees@kernel.org> # __struct_group_tag()
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20241219135734.2130002-1-aleksander.lobakin@intel.com
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-02 10:32:03 +01:00
..
acpi ACPI: CPPC: Make rmw_lock a raw_spin_lock 2024-11-08 16:28:20 +01:00
asm-generic Rename .data.once to .data..once to fix resetting WARN*_ONCE 2024-12-09 10:32:59 +01:00
clocksource
crypto
drm drm/dp_mst: Fix resetting msg rx state after topology removal 2024-12-14 19:59:55 +01:00
dt-bindings
keys
kunit
kvm
linux tcp_bpf: Add sk_rmem_alloc related logic for tcp_bpf ingress redirection 2025-01-02 10:32:00 +01:00
math-emu
media media: v4l2-core: v4l2-dv-timings: check cvt/gtf result 2024-12-09 10:32:51 +01:00
memory
misc
net tcp_bpf: Charge receive socket buffer in bpf_tcp_ingress() 2025-01-02 10:32:00 +01:00
pcmcia
ras
rdma
rv
scsi
soc net: mscc: ocelot: be resilient to loss of PTP packets during transmission 2024-12-19 18:11:29 +01:00
sound ALSA: usb-audio: Update UMP group attributes for GTB blocks, too 2024-12-14 20:00:23 +01:00
target
trace sched: Remove vruntime from trace_sched_stat_runtime() 2024-12-14 20:00:19 +01:00
uapi stddef: make __struct_group() UAPI C++-friendly 2025-01-02 10:32:03 +01:00
ufs scsi: ufs: core: Make DMA mask configuration more flexible 2024-12-14 20:00:11 +01:00
vdso
video
xen