Skip to content

Commit b4adc04

Browse files
author
Paolo Abeni
committed
Merge tag 'nf-24-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
Pablo Neira Ayuso says: ==================== Netfilter/IPVS fixes for net The following series contains two fixes for Netfilter/IPVS: 1) Possible build failure in IPVS on systems with less than 512MB memory due to incorrect use of clamp(), from David Laight. 2) Fix bogus lockdep nesting splat with ipset list:set type, from Phil Sutter. netfilter pull request 24-12-19 * tag 'nf-24-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: ipset: Fix for recursive locking warning ipvs: Fix clamp() of ip_vs_conn_tab on small memory systems ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents b95c8c3 + 70b6f46 commit b4adc04

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

net/netfilter/ipset/ip_set_list_set.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,8 @@ init_list_set(struct net *net, struct ip_set *set, u32 size)
611611
return true;
612612
}
613613

614+
static struct lock_class_key list_set_lockdep_key;
615+
614616
static int
615617
list_set_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
616618
u32 flags)
@@ -627,6 +629,7 @@ list_set_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
627629
if (size < IP_SET_LIST_MIN_SIZE)
628630
size = IP_SET_LIST_MIN_SIZE;
629631

632+
lockdep_set_class(&set->lock, &list_set_lockdep_key);
630633
set->variant = &set_variant;
631634
set->dsize = ip_set_elem_len(set, tb, sizeof(struct set_elem),
632635
__alignof__(struct set_elem));

net/netfilter/ipvs/ip_vs_conn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,8 +1495,8 @@ int __init ip_vs_conn_init(void)
14951495
max_avail -= 2; /* ~4 in hash row */
14961496
max_avail -= 1; /* IPVS up to 1/2 of mem */
14971497
max_avail -= order_base_2(sizeof(struct ip_vs_conn));
1498-
max = clamp(max, min, max_avail);
1499-
ip_vs_conn_tab_bits = clamp_val(ip_vs_conn_tab_bits, min, max);
1498+
max = clamp(max_avail, min, max);
1499+
ip_vs_conn_tab_bits = clamp(ip_vs_conn_tab_bits, min, max);
15001500
ip_vs_conn_tab_size = 1 << ip_vs_conn_tab_bits;
15011501
ip_vs_conn_tab_mask = ip_vs_conn_tab_size - 1;
15021502

0 commit comments

Comments
 (0)