From: Patrick McHardy <kaber@trash.net>
To: Nuutti Kotivuori <naked@iki.fi>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: Re: netfilter QUEUE target and packet socket interactions buggy or not
Date: Sat, 17 Sep 2005 19:59:17 +0200 [thread overview]
Message-ID: <432C5975.6060009@trash.net> (raw)
In-Reply-To: <87irx396xk.fsf@aka.i.naked.iki.fi>
Nuutti Kotivuori wrote:
> Nuutti Kotivuori wrote:
>
>>Patrick McHardy wrote:
>>
>>>This means inode->i_security was NULL. AFAICT it is only set to NULL in
>>>inode_free_security() when the inode is freed. This shouldn't happen
>>>while the packet is queued since the skb should hold a reference to
>>>the socket on the output path. So it could be some protocol forgetting
>>>to increase the refcnt when taking a reference.
>>
>>Right.
>
> Okay, I said "right" because I did not have time to read the code and
> really understand what's happening ;-)
>
> Now I did - and I hope I got it right. So what you are saying is that
> the skb is just fine, but the skb references a socket (skb->sk) and
> that socket has been freed, even though the skb still lives? And
> because of that, SOCK_INODE(skb->sk->sk_socket)->i_security is NULL,
> so accessing sclass from there causes the kernel panic?
Yes.
> If that is correct, then I guess I could add a test to see if
> i_security member is NULL - and if so, print out a hexdump of the
> packet. Or even, as a really hackish workaround, just return NF_ACCEPT
> if that's the case (selinux isn't really needed here, just enabled by
> default).
>
> But also, if it is that particular spot that causes this exact crash -
> the problem should go away if selinux is disabled, even though the bug
> still exists (socket being freed before skb stops referencing it).
>
> Just brainstorming here, so people can point out flaws in my thinking
> if they happen to stumble on such. I will investigate further.
It will probably cause problems in other places as well.
next prev parent reply other threads:[~2005-09-17 17:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 22:12 netfilter QUEUE target and packet socket interactions buggy or not Nuutti Kotivuori
2005-09-12 22:11 ` David S. Miller
2005-09-12 22:34 ` Nuutti Kotivuori
2005-09-13 10:54 ` Nuutti Kotivuori
2005-09-13 16:33 ` Patrick McHardy
2005-09-13 18:22 ` Nuutti Kotivuori
2005-09-13 18:22 ` Nuutti Kotivuori
2005-09-14 2:52 ` Patrick McHardy
2005-09-14 8:31 ` Nuutti Kotivuori
2005-09-14 12:10 ` Nuutti Kotivuori
2005-09-14 12:20 ` Nuutti Kotivuori
2005-09-15 8:50 ` Nuutti Kotivuori
2005-09-17 17:59 ` Patrick McHardy [this message]
2005-09-16 13:38 ` Nuutti Kotivuori
2005-09-17 17:57 ` Patrick McHardy
2005-09-18 7:27 ` David S. Miller
2005-09-18 10:37 ` Nuutti Kotivuori
2005-09-19 10:54 ` Nuutti Kotivuori
2005-09-19 13:34 ` Nuutti Kotivuori
2005-09-18 7:41 ` Eric Leblond
2005-09-14 11:20 ` Nuutti Kotivuori
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=432C5975.6060009@trash.net \
--to=kaber@trash.net \
--cc=naked@iki.fi \
--cc=netfilter-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.