[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <589819.72705.qm@web36605.mail.mud.yahoo.com>
Date: Sat, 21 Jul 2007 11:11:43 -0700 (PDT)
From: Casey Schaufler <casey@...aufler-ca.com>
To: Tetsuo Handa <from-netdev@...ove.SAKURA.ne.jp>, kaber@...sh.net,
jmorris@...ei.org
Cc: netdev@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [PATCH 1/1] Allow LSM to use IP address/port number.
--- Tetsuo Handa <from-netdev@...ove.SAKURA.ne.jp> wrote:
>
> Hello.
>
> Patrick McHardy wrote:
> > Quoting Tetsuo:
> > > > So, my approach is not using security context associated with a socket
> > > > but security context associated with a process.
> > Isn't the socket context derived from the process context?
> Not so regarding my case.
>
> static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t
> priority)
> {
> sk->sk_security = current->security;
> return 0;
> }
>
> will not help what I want to do.
> So, I'm not planning to use "sk->sk_security".
Before you go too far down this path please note that the quoted
code is bad* because back pointers from sockets to tasks can't be
reliable. See later versions for more reasonable behavior.
> I'm planning to use "current->security" at accept()/recvmsg() time.
The delivery of packets and the completion of these syscalls are
related but independent events. Be careful about the relationship
between the events and the placement of your checks.
----
* Stephen had good comments on the details on list earlier.
Casey Schaufler
casey@...aufler-ca.com
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists