]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ipv6: nf_defrag: accept duplicate fragments again
authorGuillaume Nault <gnault@redhat.com>
Thu, 6 Jun 2019 16:04:00 +0000 (18:04 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 7 Jun 2019 12:49:01 +0000 (14:49 +0200)
commitd147fb1e5ce3b4fe44858cb681ea1a9664a91b07
tree03c6a9baaa651973f12ee993491eb295023ee42c
parenta73cd8a397e9a7a557bee38be6e60d96f8fca8b4
netfilter: ipv6: nf_defrag: accept duplicate fragments again

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: a73cd8a397e9 ("netfilter: ipv6: nf_defrag: fix leakage of unqueued fragments")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv6/netfilter/nf_conntrack_reasm.c