[PATCH] powerpc32/bpf: return false from bpf_jit_supports_fsession() on ppc32

DORMANTno replies

From: Karl Mehltretter <hidden>
Date: 2026-10-03 18:42:58
Also in: bpf, lkml
Subsystem: bpf jit for powerpc (32-bit and 64-bit), bpf [general] (safe dynamic programs and tools), linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Hari Bathini, Christophe Leroy, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Madhavan Srinivasan, Linus Torvalds

bpf_jit_supports_fsession() returns bool. Commit 92258b5bf1ec
("powerpc32/bpf: Add fsession support") made it return -EOPNOTSUPP on
ppc32 until fsession is validated there. The negative value converts to
true, so the verifier does not reject fsession programs on ppc32. Such a
program loads, and only attaching it fails because
__arch_prepare_bpf_trampoline() returns -EOPNOTSUPP on ppc32.

Return false instead. The load then fails with "JIT does not support
fsession". Tested with a ppc32 kernel on QEMU g3beige.

Fixes: 92258b5bf1ec ("powerpc32/bpf: Add fsession support")
Reported-by: kernel test robot <redacted>
Reported-by: Dan Carpenter <redacted>
Closes: https://lore.kernel.org/r/202608010958.cYfBCQAC-lkp@intel.com/ (local)
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <redacted>
---
 arch/powerpc/net/bpf_jit_comp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index 7a612688e7a2..64e70f3226b2 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -539,7 +539,7 @@ bool bpf_jit_supports_fsession(void)
 	 * for fsession and trampoline on ppc32.
 	 */
 	if (IS_ENABLED(CONFIG_PPC32))
-		return -EOPNOTSUPP;
+		return false;
 	return true;
 }
 
base-commit: e767a4ea70a3992c37ed604157d32f0dfbf9b1e3
-- 
2.53.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help