]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: fix the return value of push_stack
authorAnton Protopopov <a.s.protopopov@gmail.com>
Sun, 19 Oct 2025 20:21:29 +0000 (20:21 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 21 Oct 2025 18:17:25 +0000 (11:17 -0700)
commit6ea5fc92a0fc1cde976cb701db2c1dba4dcab7cf
treec7e28186f494e0ce7334cc05369ef4262c38f740
parent96d31dff3fa428845aad05c5ae3a1593f6e17add
bpf: fix the return value of push_stack

In [1] Eduard mentioned that on push_stack failure verifier code
should return -ENOMEM instead of -EFAULT. After checking with the
other call sites I've found that code randomly returns either -ENOMEM
or -EFAULT. This patch unifies the return values for the push_stack
(and similar push_async_cb) functions such that error codes are
always assigned properly.

  [1] https://lore.kernel.org/bpf/20250615085943.3871208-1-a.s.protopopov@gmail.com

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20251019202145.3944697-2-a.s.protopopov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c