• Kumar Kartikeya Dwivedi's avatar
    bpf: Rewrite kfunc argument handling · 00b85860
    Kumar Kartikeya Dwivedi authored
    As we continue to add more features, argument types, kfunc flags, and
    different extensions to kfuncs, the code to verify the correctness of
    the kfunc prototype wrt the passed in registers has become ad-hoc and
    ugly to read. To make life easier, and make a very clear split between
    different stages of argument processing, move all the code into
    verifier.c and refactor into easier to read helpers and functions.
    
    This also makes sharing code within the verifier easier with kfunc
    argument processing. This will be more and more useful in later patches
    as we are now moving to implement very core BPF helpers as kfuncs, to
    keep them experimental before baking into UAPI.
    
    Remove all kfunc related bits now from btf_check_func_arg_match, as
    users have been converted away to refactored kfunc argument handling.
    Signed-off-by: default avatarKumar Kartikeya Dwivedi <memxor@gmail.com>
    Link: https://lore.kernel.org/r/20221118015614.2013203-12-memxor@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    00b85860
verifier.c 465 KB