All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bpf: return EOPNOTSUPP when JIT is needed and not possible
@ 2021-12-09 13:40 Thadeu Lima de Souza Cascardo
  2021-12-09 19:05 ` John Fastabend
  0 siblings, 1 reply; 6+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2021-12-09 13:40 UTC (permalink / raw)
  To: bpf; +Cc: netdev, ast, daniel, linux-kernel

When a CBPF program is JITed and CONFIG_BPF_JIT_ALWAYS_ON is enabled, and
the JIT fails, it would return ENOTSUPP, which is not a valid userspace
error code.  Instead, EOPNOTSUPP should be returned.

Fixes: 290af86629b2 ("bpf: introduce BPF_JIT_ALWAYS_ON config")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 kernel/bpf/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index de3e5bc6781f..5c89bae0d6f9 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1931,7 +1931,7 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
 		fp = bpf_int_jit_compile(fp);
 		bpf_prog_jit_attempt_done(fp);
 		if (!fp->jited && jit_needed) {
-			*err = -ENOTSUPP;
+			*err = -EOPNOTSUPP;
 			return fp;
 		}
 	} else {
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-10 12:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 13:40 [PATCH] bpf: return EOPNOTSUPP when JIT is needed and not possible Thadeu Lima de Souza Cascardo
2021-12-09 19:05 ` John Fastabend
2021-12-09 19:31   ` Ido Schimmel
2021-12-09 23:03     ` Daniel Borkmann
2021-12-10  2:23       ` Jakub Kicinski
2021-12-10 12:24         ` Thadeu Lima de Souza Cascardo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.