From: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Date: Thu, 28 Sep 2023 23:16:00 +0800
Subject: [PATCH] kABI: fix bpf Tighten-ptr_to_btf_id checks
Patch-mainline: Never, kABI fix
References: git-fixes
Commit c67cae551f0d ("bpf: Tighten ptr_to_btf_id checks") removed
allow_ptr_to_map_access from struct bpf_verifier_env, add a boolean padding to
preserve kABI. While simply adding allow_ptr_to_map_access back would fix the
breakage as well, opting to change the field name just to be on the safe side.
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
include/linux/bpf_verifier.h | 5 +++++
1 file changed, 5 insertions(+)
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -501,6 +501,11 @@ struct bpf_verifier_env {
* to writes with variable offset and to indirect (helper) accesses.
*/
bool allow_uninit_stack;
+#ifndef __GENKSYMS__
+ bool __unused;
+#else
+ bool allow_ptr_to_map_access;
+#endif
bool bpf_capable;
bool bypass_spec_v1;
bool bypass_spec_v4;