ipvs: avoid kfree_rcu without 2nd arg
authorJulian Anastasov <ja@ssi.bg>
Wed, 1 Feb 2023 17:56:53 +0000 (19:56 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 2 Feb 2023 13:02:01 +0000 (14:02 +0100)
Avoid possible synchronize_rcu() as part from the
kfree_rcu() call when 2nd arg is not provided.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_est.c

index c6c61100d24457fd06a840af9121d33aee13ae08..6d71a5ff52dfd0ad02e74127b87ff87ccd41e6ec 100644 (file)
@@ -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);
index ce2a1549b30439edc56f37b7865659e17a1365b7..c5970ba416aea8dac9f174d5884cce4cf309bd96 100644 (file)
@@ -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) {