From: Paul Moore <paul.moore@hp.com>
To: Venkat Yekkirala <vyekkirala@TrustedCS.com>
Cc: selinux@tycho.nsa.gov, jmorris@namei.org, sds@tycho.nsa.gov,
tjaeger@cse.psu.edu
Subject: Re: [PATCH 10/10] MLSXFRM-v02: Auto-labeling of child sockets
Date: Wed, 02 Aug 2006 10:17:23 -0400 [thread overview]
Message-ID: <44D0B3F3.9010007@hp.com> (raw)
In-Reply-To: <36282A1733C57546BE392885C061859201466C5E@chaos.tcs.tcs-sec.com>
Venkat Yekkirala wrote:
>>Hmmm. I think we are having a bit of a disconnect here,
>>perhaps I'm not
>>explaining myself very clearly so let me give it another shot.
>>
>>Please look at net/socket.c:sys_accept() and pay attention to what
>>happens to the child socket 'newsock' ...
>>
>> 1. The child 'newsock', 'struct socket' type, is allocated
>>by a call to
>> sock_alloc()
>> 2. 'newsock' inherits it's 'type' and 'ops' fields from it's parent,
>> 'struct socket' socket, 'sock'
>> 3. A new file descriptior is allocated for 'newsock', the file
>> descriptior is called 'newfd'
>> 4. 'newfd' is associated with 'newsock'
>> 5. 'security_socket_accept()' is called
>> 6. ...
>>
>>Unless I'm mistaken, nowhere in the first four steps does the
>>'newsock->sk' field get populated by a 'struct sock *' from the accept
>>queue of 'sock'. The result is that when
>>'{security,selinux}_socket_accept()' is called the child's
>>'sk' field is
>>not yet valid meaning the inode associated with the child's
>>socket will
>>be labeled with the parent socket's SID.
>
> The sequence you mention is 100% correct. But you need to look past the
> above.
> Like I mentioned yesterday, this sid is replaced with the one from the
> child "sock" in selinux_sock_graft().
Thanks, that is what I was missing. I misunderstood your comment
yesterday about sock_graft(). Sorry for the confusion on my part.
--
paul moore
linux security @ hp
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-08-02 14:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-02 14:07 [PATCH 10/10] MLSXFRM-v02: Auto-labeling of child sockets Venkat Yekkirala
2006-08-02 14:17 ` Paul Moore [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-08-02 13:32 Venkat Yekkirala
2006-08-02 13:54 ` Paul Moore
2006-08-01 22:30 Venkat Yekkirala
2006-08-02 13:03 ` Paul Moore
2006-07-18 17:25 Venkat Yekkirala
2006-07-18 17:25 ` Venkat Yekkirala
2006-07-27 16:53 ` Venkat Yekkirala
2006-07-27 16:53 ` Venkat Yekkirala
2006-07-28 4:53 ` James Morris
2006-07-28 4:53 ` James Morris
2006-07-28 4:59 ` David Miller
2006-08-01 22:16 ` Paul Moore
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=44D0B3F3.9010007@hp.com \
--to=paul.moore@hp.com \
--cc=jmorris@namei.org \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=tjaeger@cse.psu.edu \
--cc=vyekkirala@TrustedCS.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 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.