• Kumar Kartikeya Dwivedi's avatar
    bpf: Rework process_dynptr_func · 27060531
    Kumar Kartikeya Dwivedi authored
    Recently, user ringbuf support introduced a PTR_TO_DYNPTR register type
    for use in callback state, because in case of user ringbuf helpers,
    there is no dynptr on the stack that is passed into the callback. To
    reflect such a state, a special register type was created.
    
    However, some checks have been bypassed incorrectly during the addition
    of this feature. First, for arg_type with MEM_UNINIT flag which
    initialize a dynptr, they must be rejected for such register type.
    Secondly, in the future, there are plans to add dynptr helpers that
    operate on the dynptr itself and may change its offset and other
    properties.
    
    In all of these cases, PTR_TO_DYNPTR shouldn't be allowed to be passed
    to such helpers, however the current code simply returns 0.
    
    The rejection for helpers that release the dynptr is already handled.
    
    For fixing this, we take a step back and rework existing code in a way
    that will allow fitting in all classes of helpers and have a coherent
    model for dealing with the...
    27060531
helpers.c 53.9 KB