netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "U.Mutlu" <for-gmane@mutluit.com>
To: netfilter-devel@vger.kernel.org
Subject: Re: libnetfilter_queue
Date: Thu, 02 Feb 2012 21:04:04 +0100	[thread overview]
Message-ID: <4F2AEC34.1030203@mutluit.com> (raw)
In-Reply-To: <20120202183950.GA5268@1984>

Pablo Neira Ayuso wrote, On 02/02/12 19:39:
> On Wed, Feb 01, 2012 at 04:58:29PM +0100, U.Mutlu wrote:
>> Hi,
>> who is the current maintainer of libnetfilter_queue?
>
> Me.

Oh thanks, I tried to use the demo in a virtual environment
under LXC and openvz (both actually chrooted environments)
but "something" seems to be missing as it doesn't work in
virtual environment, though it works in normal environment.
Exactly same problem happens with the netfilter demo in libmnl.

Here's the relevant strace-output (that's happening in the lib):
...
socket(PF_NETLINK, SOCK_RAW, 12)        = 5
getsockname(5, {sa_family=AF_NETLINK, pid=0, groups=00000000}, [12]) = 0
gettimeofday({1328152478, 343070}, NULL) = 0
bind(5, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(5, {sa_family=AF_NETLINK, pid=514, groups=00000000}, [12]) = 0
bind(5, {sa_family=AF_NETLINK, pid=514, groups=00000000}, 12) = 0
sendto(5, "\34\0\0\0\2\3\5\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\1\0\4\36\0\2", 28, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = -1 EC
sendto(5, "\34\0\0\0\2\3\5\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\1\0\3\36\0\2", 28, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = -1 EC
sendto(5, "\34\0\0\0\2\3\5\0\0\0\0\0\0\0\0\0\0\0\22h\10\0\1\0\1\0\0\0", 28, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = -1 ECO
close(5)                                = 0
futex(0x1f96fc4, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
futex(0x1f96f98, FUTEX_WAKE_PRIVATE, 1) = 0
...

So, sendto() to the netlink fails.
What's the reason, and what's needed to get the demo working?
Have you tested it in such virtual environments?

My guess:
I think it's a permission problem, but I don't know what kind of.
My guess is this: it runs under root account only, but the root
in the virtual environment is not the root in the normal environment,
each environment has its own root, and they differ. The uid, pid etc. in
the VM are just "translated" uid and pid I think, I think the problem lies herein.
I would appeciate it if it could be made to work also in VMs.


      reply	other threads:[~2012-02-02 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 15:58 libnetfilter_queue U.Mutlu
2012-02-02 18:39 ` libnetfilter_queue Pablo Neira Ayuso
2012-02-02 20:04   ` U.Mutlu [this message]

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=4F2AEC34.1030203@mutluit.com \
    --to=for-gmane@mutluit.com \
    --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).