mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bpf: avoid padding in struct bpf_common_attr
@ 2026-05-19 20:38 Arnd Bergmann
  2026-05-19 20:52 ` Song Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Arnd Bergmann @ 2026-05-19 20:38 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Eduard Zingerman, Kumar Kartikeya Dwivedi, Leon Hwang
  Cc: Arnd Bergmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Jiri Olsa, KP Singh, bpf, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Building linux/bpf.h with -Wpadded shows an unintentionally
added portion of padding because of the 64-bit alignment:

./usr/include/linux/bpf.h:1510:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]

Avoid this by adding explicit padding.

Fixes: f28771c0691b ("bpf: Extend BPF syscall with common attributes support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/uapi/linux/bpf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index cc4c0b62cdfa..0f0ec00cae4a 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -1507,6 +1507,7 @@ struct bpf_common_attr {
 	__u32 log_size;
 	__u32 log_level;
 	__u32 log_true_size;
+	__u32 __pad;
 };
 
 #define BPF_OBJ_NAME_LEN 16U
-- 
2.39.5


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

end of thread, other threads:[~2026-05-20 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-19 20:38 [PATCH] bpf: avoid padding in struct bpf_common_attr Arnd Bergmann
2026-05-19 20:52 ` Song Liu
2026-05-20  7:51   ` Geert Uytterhoeven
2026-05-19 21:17 ` bot+bpf-ci
2026-05-19 22:17 ` Yonghong Song
2026-05-20  6:36   ` Arnd Bergmann
2026-05-20 14:03     ` Alexei Starovoitov
2026-05-20 14:22       ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®