public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eric Paris <eparis@parisplace.org>,
	Paul Moore <paul@paul-moore.com>,
	David Miller <davem@davemloft.net>,
	John Stultz <johnstul@us.ibm.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	lkml <linux-kernel@vger.kernel.org>,
	James Morris <james.l.morris@oracle.com>,
	selinux@tycho.nsa.gov, john.johansen@canonical.com,
	LSM <linux-security-module@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [PATCH] ipv4: tcp: security_sk_alloc() needed for unicast_sock
Date: Thu, 09 Aug 2012 15:26:53 -0700	[thread overview]
Message-ID: <5024392D.3060608@schaufler-ca.com> (raw)
In-Reply-To: <1344549920.31104.701.camel@edumazet-glaptop>

On 8/9/2012 3:05 PM, Eric Dumazet wrote:
> On Thu, 2012-08-09 at 14:53 -0700, Casey Schaufler wrote:
>> On 8/9/2012 2:29 PM, Eric Dumazet wrote:
>>> smack_sk_alloc_security() uses smk_of_current() : What can be the
>>> meaning of smk_of_current() in the context of 'kernel' sockets...
>> Yes, and all of it's callers - to date - have had an appropriate
>> value of current. It is using the API in the way it is supposed to.
>> It is assuming a properly formed socket. You want to give it a
>> cobbled together partial socket structure without task context.
>> Your predecessor did not have this problem.
> My predecessor ? You mean before the patch ?
>
> tcp socket was preallocated by at kernel boot time.
>
> What is the 'user' owning this socket ?
>
> You guys focus on an implementation detail of TCP stack.
> You should never use this fake socket.
>
> I repeat : There are no true socket for these control packets.
>
> If you want them, then you'll have to add fields in timewait socket.
>
> I can decide to rewrite the whole thing just building a TCP packet on
> its own, and send it without any fake socket.
>
> Some guy 15 years ago tried to reuse some high level functions, able to
> build super packets and use sophisticated tricks, while we only want so
> send a 40 or 60 bytes packet.

OK, fine. You have an optimization. I'm good with that. Just don't
expect that the entire software stack you are taking advantage of
is going to change to accommodate your special case.


  reply	other threads:[~2012-08-09 22:32 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 18:12 NULL pointer dereference in selinux_ip_postroute_compat John Stultz
2012-08-07 21:50 ` Paul Moore
2012-08-07 21:58   ` John Stultz
2012-08-07 22:01     ` Paul Moore
2012-08-07 22:17       ` Serge E. Hallyn
2012-08-07 22:23         ` Paul Moore
2012-08-07 22:37         ` John Stultz
2012-08-08 19:14           ` John Stultz
2012-08-08 19:26             ` Paul Moore
2012-08-08 19:38               ` Eric Dumazet
2012-08-08 19:49                 ` John Stultz
2012-08-08 20:04                   ` Eric Dumazet
2012-08-08 19:50                 ` Paul Moore
2012-08-08 20:04                   ` Eric Dumazet
2012-08-08 19:59                 ` Eric Paris
2012-08-08 20:09                   ` Eric Dumazet
2012-08-08 20:32                     ` Eric Dumazet
2012-08-08 20:46                       ` Paul Moore
2012-08-08 21:54                         ` Eric Dumazet
2012-08-09  0:00                           ` Casey Schaufler
2012-08-09 13:30                             ` Paul Moore
2012-08-09 14:27                               ` Eric Dumazet
2012-08-09 15:04                                 ` Paul Moore
2012-08-09 14:50                               ` [PATCH] ipv4: tcp: security_sk_alloc() needed for unicast_sock Eric Dumazet
2012-08-09 15:07                                 ` Paul Moore
2012-08-09 15:36                                   ` Eric Dumazet
2012-08-09 15:59                                     ` Paul Moore
2012-08-09 16:05                                     ` Eric Paris
2012-08-09 16:09                                       ` Paul Moore
2012-08-09 17:46                                       ` Eric Dumazet
2012-08-09 20:06                                 ` Eric Paris
2012-08-09 20:19                                   ` Paul Moore
2012-08-09 21:29                                   ` Eric Dumazet
2012-08-09 21:53                                     ` Casey Schaufler
2012-08-09 22:05                                       ` Eric Dumazet
2012-08-09 22:26                                         ` Casey Schaufler [this message]
2012-08-09 23:38                                     ` David Miller
2012-08-09 23:56                                       ` [PATCH] ipv4: tcp: unicast_sock should not land outside of TCP stack Eric Dumazet
2012-08-10  4:05                                         ` David Miller
2012-08-08 20:35                     ` NULL pointer dereference in selinux_ip_postroute_compat Paul Moore
2012-08-08 20:51                       ` Eric Paris
2012-08-08 21:03                         ` Paul Moore
2012-08-08 21:09                           ` Eric Paris
2012-08-08 19:29             ` Eric Dumazet
2012-08-08 16:58         ` John Johansen
2012-08-07 22:26       ` John Stultz
2012-08-07 22:31         ` John Stultz

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=5024392D.3060608@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=davem@davemloft.net \
    --cc=eparis@parisplace.org \
    --cc=eric.dumazet@gmail.com \
    --cc=james.l.morris@oracle.com \
    --cc=john.johansen@canonical.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.com \
    /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