linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: file descriptor passing (jail related question)
  2002-07-19 21:58 file descriptor passing (jail related question) Shaya Potter
@ 2002-07-19 21:53 ` David S. Miller
  2002-07-19 22:35   ` Shaya Potter
  2002-07-29 11:37 ` Bill Davidsen
  1 sibling, 1 reply; 4+ messages in thread
From: David S. Miller @ 2002-07-19 21:53 UTC (permalink / raw)
  To: spotter; +Cc: linux-kernel


   From: Shaya Potter <spotter@cs.columbia.edu>
   Date: 19 Jul 2002 17:58:07 -0400

   How does file descriptor passing work.  From what I can tell it uses the
   sendmsg and recvmsg calls.  Is this only process to process over a non
   ip socket  on the same machine (what's the right terminology for this,
   just a plain FIFO?), or could one conceivably pass a file descriptor
   over an ip socket?
   
File descriptors can only be passed over AF_UNIX sockets.
These are like fancy FIFO's on the local host using the
socket APIs for the communication and synchronization.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* file descriptor passing (jail related question)
@ 2002-07-19 21:58 Shaya Potter
  2002-07-19 21:53 ` David S. Miller
  2002-07-29 11:37 ` Bill Davidsen
  0 siblings, 2 replies; 4+ messages in thread
From: Shaya Potter @ 2002-07-19 21:58 UTC (permalink / raw)
  To: linux-kernel

How does file descriptor passing work.  From what I can tell it uses the
sendmsg and recvmsg calls.  Is this only process to process over a non
ip socket  on the same machine (what's the right terminology for this,
just a plain FIFO?), or could one conceivably pass a file descriptor
over an ip socket?

I ask, because of jail.  If it's just a FIFO, then one can secure fd
passing in a jail by controlling who can talk on a socket (since
persumably fd passing is used over a pre-existing fd, and there are no
pre-existing fd's to outside the jail....)

If it can be transmited over IP, its a much more serious issue, as all
one has to do is crack a jail (root inside the jail), crack the local
system (regular user) run a program that talks to the local system over
ip, and have the cracked regular user pass a fd in.

Any other points to read that I can learn about fd passing would be
appreciated as well, as I have never used this feature in my programs,
so am somewhat ignorant in regards to it.

thanks,

shaya potter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: file descriptor passing (jail related question)
  2002-07-19 21:53 ` David S. Miller
@ 2002-07-19 22:35   ` Shaya Potter
  0 siblings, 0 replies; 4+ messages in thread
From: Shaya Potter @ 2002-07-19 22:35 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

thanks, that AF_UNIX bit was what I needed to find it in stevens.

shaya potter

On Fri, 2002-07-19 at 17:53, David S. Miller wrote:
> 
>    From: Shaya Potter <spotter@cs.columbia.edu>
>    Date: 19 Jul 2002 17:58:07 -0400
> 
>    How does file descriptor passing work.  From what I can tell it uses the
>    sendmsg and recvmsg calls.  Is this only process to process over a non
>    ip socket  on the same machine (what's the right terminology for this,
>    just a plain FIFO?), or could one conceivably pass a file descriptor
>    over an ip socket?
>    
> File descriptors can only be passed over AF_UNIX sockets.
> These are like fancy FIFO's on the local host using the
> socket APIs for the communication and synchronization.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: file descriptor passing (jail related question)
  2002-07-19 21:58 file descriptor passing (jail related question) Shaya Potter
  2002-07-19 21:53 ` David S. Miller
@ 2002-07-29 11:37 ` Bill Davidsen
  1 sibling, 0 replies; 4+ messages in thread
From: Bill Davidsen @ 2002-07-29 11:37 UTC (permalink / raw)
  To: Shaya Potter; +Cc: linux-kernel

On 19 Jul 2002, Shaya Potter wrote:

> If it can be transmited over IP, its a much more serious issue, as all
> one has to do is crack a jail (root inside the jail), crack the local
> system (regular user) run a program that talks to the local system over
> ip, and have the cracked regular user pass a fd in.

But of course you would have no more access outside the jail than the
cracked user. I would expect connections into the jail to behave as if
they were on another machine, which would prevent fd passing. At least the
last time I played with fd passing it didn't work between machines, that
may have been a bug rather than a security features, of course.

-- 
bill davidsen <davidsen@tmr.com>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-29 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-19 21:58 file descriptor passing (jail related question) Shaya Potter
2002-07-19 21:53 ` David S. Miller
2002-07-19 22:35   ` Shaya Potter
2002-07-29 11:37 ` Bill Davidsen

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).