From: Lennart Poettering <lennart@poettering.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, kernel@linuxace.com
Subject: Re: [PATCH iptables] iptables: use flock() instead of abstract unix sockets
Date: Mon, 19 Jan 2015 19:36:20 +0100 [thread overview]
Message-ID: <20150119183620.GA32042@gardel-login> (raw)
In-Reply-To: <1421690957-11279-1-git-send-email-pablo@netfilter.org>
On Mon, 19.01.15 19:09, Pablo Neira Ayuso (pablo@netfilter.org) wrote:
> Abstract unix sockets cannot be used to synchronize several concurrent
> instances of iptables since an unpriviledged process can create them and
> prevent the legitimate iptables instance from running.
>
> Use flock() and /run instead as suggested by Lennart Poettering.
Looks OK. Of course, it's a bit nasty to do the sleep() loop, but
there is no time-limited version of flock(), hence doing the sleep()
loop is kinda necessary, unless one wants to use SIGARLM, but that's
awful to do without races...
Hence, looks OK to me.
A minor optimization might be to move the lock file into its own
subdir /run/iptables/ or so, but it's OK if you don't.
Lennart
--
Lennart Poettering, Red Hat
next prev parent reply other threads:[~2015-01-19 18:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 18:09 [PATCH iptables] iptables: use flock() instead of abstract unix sockets Pablo Neira Ayuso
2015-01-19 18:36 ` Lennart Poettering [this message]
2015-01-24 22:35 ` Phil Oester
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=20150119183620.GA32042@gardel-login \
--to=lennart@poettering.net \
--cc=kernel@linuxace.com \
--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).