• Alexei Starovoitov's avatar
    bpf: reconcile bpf_tail_call and stack_depth · 80a58d02
    Alexei Starovoitov authored
    The next set of patches will take advantage of stack_depth tracking,
    so make sure that the program that does bpf_tail_call() has
    stack depth large enough for the callee.
    We could have tracked the stack depth of the prog_array owner program
    and only allow insertion of the programs with stack depth less
    than the owner, but it will break existing applications.
    Some of them have trivial root bpf program that only does
    multiple bpf_tail_calls and at init time the prog array is empty.
    In the future we may add a flag to do such tracking optionally,
    but for now play simple and safe.
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    80a58d02
verifier.c 105 KB