Skip to content
  • Pablo Neira Ayuso's avatar
    [NETFILTER]: ctnetlink: Fix expectaction mask dumping · 1cde6436
    Pablo Neira Ayuso authored
    
    
    The expectation mask has some particularities that requires a different
    handling. The protocol number fields can be set to non-valid protocols,
    ie. l3num is set to 0xFFFF. Since that protocol does not exist, the mask
    tuple will not be dumped. Moreover, this results in a kernel panic when
    nf_conntrack accesses the array of protocol handlers, that is PF_MAX (0x1F)
    long.
    
    This patch introduces the function ctnetlink_exp_dump_mask, that correctly
    dumps the expectation mask. Such function uses the l3num value from the
    expectation tuple that is a valid layer 3 protocol number. The value of the
    l3num mask isn't dumped since it is meaningless from the userspace side.
    
    Thanks to Yasuyuki Kozakai and Patrick McHardy for the feedback.
    
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1cde6436