Skip to content

Commit 2be0070

Browse files
author
CKI KWF Bot
committed
Merge: ipset: stable backport for 9.8 phase 2
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7419 JIRA: https://issues.redhat.com/browse/RHEL-115637 Omitted-fix: ba94179 ("netfilter: ipset: Remove unused htable_bits in macro ahash_region") ``` commit 8478a72 Author: Jozsef Kadlecsik <kadlec@netfilter.org> Date: Wed May 7 17:01:59 2025 +0200 netfilter: ipset: fix region locking in hash types Region locking introduced in v5.6-rc4 contained three macros to handle the region locks: ahash_bucket_start(), ahash_bucket_end() which gave back the start and end hash bucket values belonging to a given region lock and ahash_region() which should give back the region lock belonging to a given hash bucket. The latter was incorrect which can lead to a race condition between the garbage collector and adding new elements when a hash type of set is defined with timeouts. Fixes: f66ee04 ("netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports") Reported-by: Kota Toda <kota.toda@gmo-cybersecurity.com> Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> ``` Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-09-30 09:27 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small> Approved-by: Phil Sutter <psutter@redhat.com> Approved-by: Florian Westphal <fwestpha@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents adfaf66 + 4f18055 commit 2be0070

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/ipset/ip_set_hash_gen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct hbucket {
6363
#define ahash_sizeof_regions(htable_bits) \
6464
(ahash_numof_locks(htable_bits) * sizeof(struct ip_set_region))
6565
#define ahash_region(n, htable_bits) \
66-
((n) % ahash_numof_locks(htable_bits))
66+
((n) / jhash_size(HTABLE_REGION_BITS))
6767
#define ahash_bucket_start(h, htable_bits) \
6868
((htable_bits) < HTABLE_REGION_BITS ? 0 \
6969
: (h) * jhash_size(HTABLE_REGION_BITS))

0 commit comments

Comments
 (0)