netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jan Engelhardt <jengelh@inai.de>,
	netfilter-devel@vger.kernel.org, kernel@linuxace.com,
	lennart@poettering.net
Subject: Re: [PATCH iptables] iptables: use IPC semaphore instead of abstract unix sockets
Date: Mon, 19 Jan 2015 12:59:10 +0000	[thread overview]
Message-ID: <20150119125909.GL17886@acer.localdomain> (raw)
In-Reply-To: <20150119130024.GA4410@salvia>

On 19.01, Pablo Neira Ayuso wrote:
> On Mon, Jan 19, 2015 at 12:51:19PM +0000, Patrick McHardy wrote:
> > On 19.01, Pablo Neira Ayuso wrote:
> > > On Sun, Jan 18, 2015 at 10:28:32PM +0100, Jan Engelhardt wrote:
> > > > On Sunday 2015-01-18 22:13, Pablo Neira Ayuso wrote:
> > > > 
> > > > >This patch introduces a semaphore
> > > > >index b18022e..80eed2c 100644
> > > > >--- a/iptables/xshared.c
> > > > >+++ b/iptables/xshared.c
> > > > >+static int xtables_check_owner(int semid)
> > > > >+{
> > > > >+	int ret;
> > > > >+	struct semid_ds ds;
> > > > >+
> > > > >+	ret = semctl(semid, 0, IPC_STAT, &ds);
> > > > 
> > > > Is there a particular reason you are not using the POSIX semaphores?
> > > > [sem_open/shm_open as per sem_overview(7)].
> > > 
> > > Please, read the patch description:
> > > 
> > > "This patch introduces a semaphore that is identified by the path to
> > > the iptables binary, it also relies on SEM_UNDO so the kernel performs
> > > the up() operation at process exit to avoid races with signals. This
> > > also avoids file locks that require a writable filesystem."
> > 
> > Is it wise to use the path? Not that its very common, but multiple
> > binaries would still race. Any reason you chose not to use something
> > globally unique?
> 
> What kind of race are you worrying about?

Multiple iptables binaries, which would obviously have different paths.
As I said, not common, but possible.

  reply	other threads:[~2015-01-19 12:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18 21:13 [PATCH iptables] iptables: use IPC semaphore instead of abstract unix sockets Pablo Neira Ayuso
2015-01-18 21:28 ` Jan Engelhardt
2015-01-19 12:24   ` Pablo Neira Ayuso
2015-01-19 12:51     ` Patrick McHardy
2015-01-19 13:00       ` Pablo Neira Ayuso
2015-01-19 12:59         ` Patrick McHardy [this message]
2015-01-19 13:06         ` Pablo Neira Ayuso
2015-01-19 13:08           ` Patrick McHardy
2015-01-19 13:21             ` Pablo Neira Ayuso
2015-01-19 13:19           ` Patrick Schaaf
2015-01-19 13:34             ` Patrick Schaaf
2015-01-19 15:54           ` Jan Engelhardt
2015-01-23  3:04             ` Lennart Poettering
2015-01-19 14:21     ` Lennart Poettering
2015-01-19 14:17 ` Lennart Poettering

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=20150119125909.GL17886@acer.localdomain \
    --to=kaber@trash.net \
    --cc=jengelh@inai.de \
    --cc=kernel@linuxace.com \
    --cc=lennart@poettering.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).