Thread (10 messages) 10 messages, 3 authors, 2022-09-11

[PATCH bpf-next v5 2/6] bpf: Add stub for btf_struct_access()

flat view
STALE1490d LANDED: 1 (1M)

From: Daniel Xu <hidden>
Date: 2022-09-07 16:41:32
Also in: bpf, lkml, netfilter-devel
Subsystem: bpf [core], bpf [general] (safe dynamic programs and tools), the rest · Maintainers: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Linus Torvalds

Revision v5 of 4 in this series; 1 review trailer (1 from subsystem maintainers); landed in mainline as d4f7bdb2ed7b on 2022-09-11.

Revisions (4)
  1. v1 [diff vs current]
  2. v3 [diff vs current]
  3. v4 [diff vs current]
  4. v5 current
Add corresponding unimplemented stub for when CONFIG_BPF_SYSCALL=n

Signed-off-by: Daniel Xu <redacted>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---
 include/linux/bpf.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 4d32f125f4af..cee2b008f2b5 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -2169,6 +2169,15 @@ static inline struct bpf_prog *bpf_prog_by_id(u32 id)
 	return ERR_PTR(-ENOTSUPP);
 }
 
+static inline int btf_struct_access(struct bpf_verifier_log *log,
+				    const struct btf *btf,
+				    const struct btf_type *t, int off, int size,
+				    enum bpf_access_type atype,
+				    u32 *next_btf_id, enum bpf_type_flag *flag)
+{
+	return -EACCES;
+}
+
 static inline const struct bpf_func_proto *
 bpf_base_func_proto(enum bpf_func_id func_id)
 {
-- 
2.37.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help