mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
bpf: check pending signals while verifying programs
Malicious user space may try to force the verifier to use as much cpu time and memory as possible. Hence check for pending signals while verifying the program. Note that suspend of sys_bpf(PROG_LOAD) syscall will lead to EAGAIN, since the kernel has to release the resources used for program verification. Reported-by: Anatoly Trosinenko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Acked-by: Edward Cree <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
This commit is contained in:
1 parent
025dceb0fa
commit
c3494801cd
1 file changed
+3
@@ -5148,6 +5148,9 @@ static int do_check(struct bpf_verifier_env *env)
|
||||
goto process_bpf_exit;
|
||||
}
|
||||
|
||||
if (signal_pending(current))
|
||||
return -EAGAIN;
|
||||
|
||||
if (need_resched())
|
||||
cond_resched();
|
||||
|
||||
|
||||
Reference in new issue
Block a user