netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: Jan Engelhardt <jengelh@inai.de>
Cc: "Grzegorz Kuczyński" <grzegorz.kuczynski@interia.eu>,
	"Netfilter Devel" <netfilter-devel@vger.kernel.org>
Subject: [PATCH xtables-addons 5/8] xt_condition: remove `wmb` when adding new variable.
Date: Sun, 22 Aug 2021 17:35:53 +0100	[thread overview]
Message-ID: <20210822163556.693925-6-jeremy@azazel.net> (raw)
In-Reply-To: <20210822163556.693925-1-jeremy@azazel.net>

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extensions/xt_condition.c b/extensions/xt_condition.c
index e1672985e59b..d390faeac1b0 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.32.0


  parent reply	other threads:[~2021-08-22 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 16:35 [PATCH xtables-addons 0/8] xt_condition: per-net improvements Jeremy Sowden
2021-08-22 16:35 ` [PATCH xtables-addons 1/8] build: bump minimum supported kernel version from 4.15 to 4.16 Jeremy Sowden
2021-08-22 19:42   ` Jan Engelhardt
2021-08-22 16:35 ` [PATCH xtables-addons 2/8] xt_condition: use sizeof_field macro to size variable name Jeremy Sowden
2021-08-22 16:35 ` [PATCH xtables-addons 3/8] xt_condition: use `xt_check_proc_name` to validate /proc file-name Jeremy Sowden
2021-08-22 16:35 ` [PATCH xtables-addons 4/8] xt_condition: make mutex per-net Jeremy Sowden
2021-08-22 16:35 ` Jeremy Sowden [this message]
2021-08-22 16:35 ` [PATCH xtables-addons 6/8] xt_condition: use `proc_net_condition` member of `struct condition_net`to signal that `condition_net_exit` has been called Jeremy Sowden
2021-08-22 16:35 ` [PATCH xtables-addons 7/8] xt_condition: don't delete variables in `condition_net_exit` Jeremy Sowden
2021-08-22 16:35 ` [PATCH xtables-addons 8/8] xt_condition: simplify clean-up of variables Jeremy Sowden
2021-08-22 19:42 ` [PATCH xtables-addons 0/8] xt_condition: per-net improvements Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210822163556.693925-6-jeremy@azazel.net \
    --to=jeremy@azazel.net \
    --cc=grzegorz.kuczynski@interia.eu \
    --cc=jengelh@inai.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).