LoongArch: BPF: Set bpf_jit_bypass_spec_v1/v4()
authorTiezhu Yang <yangtiezhu@loongson.cn>
Tue, 5 Aug 2025 11:00:22 +0000 (19:00 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Tue, 5 Aug 2025 11:00:22 +0000 (19:00 +0800)
JITs can set bpf_jit_bypass_spec_v1/v4() if they want the verifier to
skip analysis/patching for the respective vulnerability, it is safe to
set both bpf_jit_bypass_spec_v1/v4(), because there is no speculation
barrier instruction for LoongArch.

Suggested-by: Luis Gerhorst <luis.gerhorst@fau.de>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/net/bpf_jit.c

index 4ea8ae4cf0ca0a523b952c4275d9eff215cdcb49..abfdb6bb5c3825ce2c4070bb41367045b68f1f73 100644 (file)
@@ -1915,6 +1915,16 @@ out_free:
        goto out_offset;
 }
 
+bool bpf_jit_bypass_spec_v1(void)
+{
+       return true;
+}
+
+bool bpf_jit_bypass_spec_v4(void)
+{
+       return true;
+}
+
 /* Indicate the JIT backend supports mixing bpf2bpf and tailcalls. */
 bool bpf_jit_supports_subprog_tailcalls(void)
 {