Skip to contentSkip to conversation

ipvs: avoid kfree_rcu without 2nd arg

PATCH Applied Julian Anastasov 2 participants 2 messages Feb 1, 2023 – Feb 2, 2023

Subsystems (4)
lore
Share & tools
lore

Julian Anastasov

author maintainer
#0 lore raw

PATCH 1/1 ipvs: avoid kfree_rcu without 2nd arg

Avoid possible synchronize_rcu() as part from the
kfree_rcu() call when 2nd arg is not provided.

---
 include/net/ip_vs.h            | 1 +
 net/netfilter/ipvs/ip_vs_est.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
include/net/ip_vs.h +1 -0
index c6c61100d244..6d71a5ff52df 100644
@@ -461,6 +461,7 @@ void ip_vs_stats_free(struct ip_vs_stats *stats);
 
 /* Multiple chains processed in same tick */
 struct ip_vs_est_tick_data {
+	struct rcu_head		rcu_head;
 	struct hlist_head	chains[IPVS_EST_TICK_CHAINS];
 	DECLARE_BITMAP(present, IPVS_EST_TICK_CHAINS);
 	DECLARE_BITMAP(full, IPVS_EST_TICK_CHAINS);
net/netfilter/ipvs/ip_vs_est.c +1 -1
index df56073bb282..25c7118d9348 100644
@@ -549,7 +549,7 @@ void ip_vs_stop_estimator(struct netns_ipvs *ipvs, struct ip_vs_stats *stats)
 	__set_bit(row, kd->avail);
 	if (!kd->tick_len[row]) {
 		RCU_INIT_POINTER(kd->ticks[row], NULL);
-		kfree_rcu(td);
+		kfree_rcu(td, rcu_head);
 	}
 	kd->est_count--;
 	if (kd->est_count) {
Signature · 1 line
2.39.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Julian Anastasov

Avoid possible synchronize_rcu() as part from the
kfree_rcu() call when 2nd arg is not provided.

Applied to nf-next, thanks