Commit b4adc049 authored by Paolo Abeni's avatar Paolo Abeni
Browse files
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/20241218234137.1687288-1-pablo@netfilter.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents b95c8c33 70b6f46a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -611,6 +611,8 @@ init_list_set(struct net *net, struct ip_set *set, u32 size)
	return true;
}

static struct lock_class_key list_set_lockdep_key;

static int
list_set_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
		u32 flags)
@@ -627,6 +629,7 @@ list_set_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
	if (size < IP_SET_LIST_MIN_SIZE)
		size = IP_SET_LIST_MIN_SIZE;

	lockdep_set_class(&set->lock, &list_set_lockdep_key);
	set->variant = &set_variant;
	set->dsize = ip_set_elem_len(set, tb, sizeof(struct set_elem),
				     __alignof__(struct set_elem));
+2 −2
Original line number Diff line number Diff line
@@ -1495,8 +1495,8 @@ int __init ip_vs_conn_init(void)
	max_avail -= 2;		/* ~4 in hash row */
	max_avail -= 1;		/* IPVS up to 1/2 of mem */
	max_avail -= order_base_2(sizeof(struct ip_vs_conn));
	max = clamp(max, min, max_avail);
	ip_vs_conn_tab_bits = clamp_val(ip_vs_conn_tab_bits, min, max);
	max = clamp(max_avail, min, max);
	ip_vs_conn_tab_bits = clamp(ip_vs_conn_tab_bits, min, max);
	ip_vs_conn_tab_size = 1 << ip_vs_conn_tab_bits;
	ip_vs_conn_tab_mask = ip_vs_conn_tab_size - 1;