Networking Forums

Networking Forums > Computer Networking > Linux Networking > Re: Why does SO_BINDTODEVICE require root?

Reply
Thread Tools Display Modes

Re: Why does SO_BINDTODEVICE require root?

 
 
David Schwartz
Guest
Posts: n/a

 
      10-08-2008, 09:56 AM
On Oct 7, 11:33*pm, "Jim Talbut" <www.spudsoft.co.uk> wrote:

> Why does SO_BINDTODEVICE require root?


Because it sends packets in the wrong direction.

> This dooms a whole class of applications to run (at least in part) as root
> and seems to have an overall security reducing effect, so what's the reason
> for making it root only?


What class of applications would that be?

DS
 
Reply With Quote
 
 
 
 
David Schwartz
Guest
Posts: n/a

 
      10-08-2008, 10:22 PM
On Oct 8, 11:57*am, "Jim Talbut" <www.spudsoft.co.uk> wrote:

> BINDTODEVICE stops a socket from interacting with any device except the
> bound one - why does this involve sending packets in the wrong direction?
> In my particular case the socket involved won't be sending any packets at
> all - it's strictly a listener.


Then why not bind to the address? Why bind to the device?

> > > This dooms a whole class of applications to run (at least in part) as
> > > root
> > > and seems to have an overall security reducing effect, so what's the
> > > reason
> > > for making it root only?


> > What class of applications would that be?


> Those that receive broadcast packets from machines without IP addresses and
> want to respond to them.
> It might sound a bit specific, but DHCP servers can't be the only ones in
> this class (though that is my specific problem).


The problem is not with SO_BINDTODEVICE, it's with the fact that there
is no generic, unprivileged way to interact with a device other than
by address or to track which device a packet was received on.
SO_BINDTODEVICE is a hack to cover the fact that there is no sensible
interface.

Unprivileged applications are assumed not to be interested in the
specifics of how their traffic gets to its destination because there
is no API to let them do so.

It would be the same if you wanted to implement TCP yourself on a
machine that didn't have a TCP implementation. You would need low-
level access only 'root' would be allowed because nobody installed/
developer/activated the high-level access.

DS
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SO_BINDTODEVICE Florian Weingarten Linux Networking 3 12-18-2008 10:19 AM
SO_BINDTODEVICE socket option Gaurav Linux Networking 0 04-26-2007 12:36 PM
Does use of iptables require admin (root) account ? charlotte Linux Networking 4 04-28-2006 12:22 PM
WG311T wireless card is showing c.root-server.net and other root-server.net in netstat. Robert Home Networking 1 05-06-2005 08:13 PM
Postfix config - cron messages for root going to root@ISP. Doug Laidlaw Linux Networking 5 02-27-2005 03:21 PM



1 2 3 4 5 6 7 8 9 10 11