netfilter: nf_conncount: don't skip eviction when age is negative
authorFlorian Westphal <fw@strlen.de>
Fri, 28 Dec 2018 00:24:43 +0000 (01:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 20:40:28 +0000 (21:40 +0100)
commitef68fdb5179c9ac7efe4a8a18e9a6cf2034e475b
treef29c854510dd25da1241ecb668db3bd287df85ae
parentc5cbe95a4ba87c06cb25ff2324919a1304178439
netfilter: nf_conncount: don't skip eviction when age is negative

commit 4cd273bb91b3001f623f516ec726c49754571b1a upstream.

age is signed integer, so result can be negative when the timestamps
have a large delta.  In this case we want to discard the entry.

Instead of using age >= 2 || age < 0, just make it unsigned.

Fixes: b36e4523d4d56 ("netfilter: nf_conncount: fix garbage collection confirm race")
Reviewed-by: Shawn Bohrer <sbohrer@cloudflare.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_conncount.c