]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_conncount: garbage collection is not skipped when jiffies wrap around
authorNicklas Bo Jensen <njensen@akamai.com>
Thu, 27 Feb 2025 13:32:34 +0000 (13:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:10 +0000 (12:54 -0700)
commita5396ee0f541802f8aa4bd62ab238a485c8cd0f1
tree4dbf9d7f7d5ea3b989b6364c73d9a68ff37b8cbe
parent198907fa1444e83b9deb056b94fdd9cb7f945f28
netfilter: nf_conncount: garbage collection is not skipped when jiffies wrap around

[ Upstream commit df08c94baafb001de6cf44bb7098bb557f36c335 ]

nf_conncount is supposed to skip garbage collection if it has already
run garbage collection in the same jiffy. Unfortunately, this is broken
when jiffies wrap around which this patch fixes.

The problem is that last_gc in the nf_conncount_list struct is an u32,
but jiffies is an unsigned long which is 8 bytes on my systems. When
those two are compared it only works until last_gc wraps around.

See bug report: https://bugzilla.netfilter.org/show_bug.cgi?id=1778
for more details.

Fixes: d265929930e2 ("netfilter: nf_conncount: reduce unnecessary GC")
Signed-off-by: Nicklas Bo Jensen <njensen@akamai.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conncount.c