bpf: Return -EFAULT on misconfigurations
authorLuis Gerhorst <luis.gerhorst@fau.de>
Tue, 3 Jun 2025 20:57:53 +0000 (22:57 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 10 Jun 2025 03:11:09 +0000 (20:11 -0700)
commitfd508bde5d646fe8b8e664ae7c523d2d467d6c76
treeb418d73202aad2dab42e457c10fb4f9d3514c273
parent8b7df50fd40d7ab3b467c9739965b0e5a02e6113
bpf: Return -EFAULT on misconfigurations

Mark these cases as non-recoverable to later prevent them from being
caught when they occur during speculative path verification.

Eduard writes [1]:

  The only pace I'm aware of that might act upon specific error code
  from verifier syscall is libbpf. Looking through libbpf code, it seems
  that this change does not interfere with libbpf.

[1] https://lore.kernel.org/all/785b4531ce3b44a84059a4feb4ba458c68fce719.camel@gmail.com/

Signed-off-by: Luis Gerhorst <luis.gerhorst@fau.de>
Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Henriette Herzog <henriette.herzog@rub.de>
Cc: Maximilian Ott <ott@cs.fau.de>
Cc: Milan Stephan <milan.stephan@fau.de>
Link: https://lore.kernel.org/r/20250603205800.334980-3-luis.gerhorst@fau.de
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c