Blob Blame History Raw
From: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Date: Tue, 01 Fed 2022 08:43:36 +0800
Subject: [PATCH] kABI padding for bpf
Patch-mainline: Never, kABI padding
References: bsc#1179531

Add kABI padding to important BPF types

Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
 include/linux/bpf.h    |    3 ++-
 include/linux/filter.h |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -180,7 +180,8 @@ struct bpf_map {
 	u32 btf_vmlinux_value_type_id;
 	bool bypass_spec_v1;
 	bool frozen; /* write-once; write-protected by freeze_mutex */
-	/* 22 bytes hole */
+	void *suse_kabi_padding;
+	/* 22-sizeof(void*) bytes hole */
 
 	/* The 3rd and 4th cacheline with misc members to avoid false sharing
 	 * particularly with refcounting.
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -586,6 +586,7 @@ struct bpf_prog {
 					    const struct bpf_insn *insn);
 	struct bpf_prog_aux	*aux;		/* Auxiliary fields */
 	struct sock_fprog_kern	*orig_prog;	/* Original BPF program */
+	void			*suse_kabi_padding;
 	/* Instructions for interpreter */
 	struct sock_filter	insns[0];
 	struct bpf_insn		insnsi[];