• Guillaume Nault's avatar
    netfilter: ipv6: nf_defrag: accept duplicate fragments again · 8a3dca63
    Guillaume Nault authored
    When fixing the skb leak introduced by the conversion to rbtree, I
    forgot about the special case of duplicate fragments. The condition
    under the 'insert_error' label isn't effective anymore as
    nf_ct_frg6_gather() doesn't override the returned value anymore. So
    duplicate fragments now get NF_DROP verdict.
    
    To accept duplicate fragments again, handle them specially as soon as
    inet_frag_queue_insert() reports them. Return -EINPROGRESS which will
    translate to NF_STOLEN verdict, like any accepted fragment. However,
    such packets don't carry any new information and aren't queued, so we
    just drop them immediately.
    
    Fixes: a0d56cb9 ("netfilter: ipv6: nf_defrag: fix leakage of unqueued fragments")
    Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    8a3dca63
nf_conntrack_reasm.c 13.3 KB