ANDROID: fix bpf jit + cfi interactions
authorMaciej Żenczykowski <maze@google.com>
Wed, 29 Jan 2020 14:45:56 +0000 (06:45 -0800)
committerCosmin Tanislav <demonsingur@gmail.com>
Thu, 16 May 2024 07:58:23 +0000 (10:58 +0300)
change from:
  https://android-review.googlesource.com/c/kernel/common/+/1126406
  ANDROID: bpf: validate bpf_func when BPF_JIT is enabled with CFI

was incorrectly reverted in:
  https://android-review.googlesource.com/c/kernel/common/+/1184358
  UPSTREAM: bpf: multi program support for cgroup+bpf

Test: builds
Bug: 121213201
Bug: 138317270
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2b238de61340e58eb71aaa6cf6b59945a8740a08

include/linux/filter.h

index 5a5786240006e89b0006428e6810cb8f6353cc54..f33f80ee9dc6fa13218cfdff8428ca1a57d02715 100644 (file)
@@ -536,7 +536,7 @@ static inline void bpf_jit_set_header_magic(struct bpf_binary_header *hdr)
 }
 #endif
 
-#define BPF_PROG_RUN(filter, ctx)  (*(filter)->bpf_func)(ctx, (filter)->insnsi)
+#define BPF_PROG_RUN(filter, ctx)  bpf_call_func(filter, ctx)
 
 #define BPF_SKB_CB_LEN QDISC_CB_PRIV_LEN