On Fri, Sep 4, 2020 at 4:29 AM Lorenz Bauer <lmb@xxxxxxxxxxxxxx> wrote: > > check_func_arg has a plethora of weird if statements with empty branches. > They work around the fact that *_OR_NULL argument types should accept a > SCALAR_VALUE register, as long as it's value is 0. These statements make > it difficult to reason about the type checking logic. > > Instead, skip more detailed type checking logic iff the register is 0, > and the function expects a nullable type. This allows simplifying the type > checking itself. > > Signed-off-by: Lorenz Bauer <lmb@xxxxxxxxxxxxxx> > --- > kernel/bpf/verifier.c | 66 ++++++++++++++++++++----------------------- > 1 file changed, 31 insertions(+), 35 deletions(-) > I like this change. Acked-by: Andrii Nakryiko <andriin@xxxxxx>