]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_condition: remove `wmb` when adding new variable
authorJeremy Sowden <jeremy@azazel.net>
Sun, 22 Aug 2021 16:35:53 +0000 (17:35 +0100)
committerJan Engelhardt <jengelh@inai.de>
Sun, 22 Aug 2021 19:39:36 +0000 (21:39 +0200)
Originally, some accesses to `conditions_list` were protected by RCU and
the memory-barrier was needed to ensure that the new variable was fully
initialized before being added to the list.  These days, however, all
accesses are protected by the `proc_lock` mutex, so the barrier is no
longer required.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
extensions/xt_condition.c

index e1672985e59b15aa19df1183d6fe801ef7a9852d..d390faeac1b090f3e9369aae5bec9164fab46aed 100644 (file)
@@ -176,7 +176,7 @@ static int condition_mt_check(const struct xt_mtchk_param *par)
                      make_kgid(&init_user_ns, condition_gid_perms));
        var->refcount = 1;
        var->enabled  = false;
-       wmb();
+
        list_add(&var->list, &condition_net->conditions_list);
        mutex_unlock(&condition_net->proc_lock);
        info->condvar = var;