From 76768e3f6dd035378b1dae9688b59fca506903b7 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Sun, 22 Aug 2021 17:35:53 +0100 Subject: [PATCH] xt_condition: remove `wmb` when adding new variable 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 --- extensions/xt_condition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/xt_condition.c b/extensions/xt_condition.c index e167298..d390fae 100644 --- a/extensions/xt_condition.c +++ b/extensions/xt_condition.c @@ -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; -- 2.47.2