• Willem de Bruijn's avatar
    rose: limit sk_filter trim to payload · f4979fce
    Willem de Bruijn authored
    Sockets can have a filter program attached that drops or trims
    incoming packets based on the filter program return value.
    
    Rose requires data packets to have at least ROSE_MIN_LEN bytes. It
    verifies this on arrival in rose_route_frame and unconditionally pulls
    the bytes in rose_recvmsg. The filter can trim packets to below this
    value in-between, causing pull to fail, leaving the partial header at
    the time of skb_copy_datagram_msg.
    
    Place a lower bound on the size to which sk_filter may trim packets
    by introducing sk_filter_trim_cap and call this for rose packets.
    Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
    Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f4979fce
filter.h 17.1 KB