* Re: SIOCETHTOOL history ?
2003-05-06 12:37 arun
@ 2003-05-06 11:49 ` David S. Miller
0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2003-05-06 11:49 UTC (permalink / raw)
To: akumar; +Cc: netdev
From: "arun" <akumar@omnesysindia.com>
Date: Tue, 6 May 2003 18:07:48 +0530
I have used SIOCGMIIPHY before and it seemed not to require
any su rights or capabilities.
Yes it does:
/*
* These ioctl calls:
* - require superuser power.
* - require strict serialization.
* - return a value
*/
case SIOCETHTOOL:
case SIOCGMIIPHY:
case SIOCGMIIREG:
if (!capable(CAP_NET_ADMIN))
return -EPERM;
^ permalink raw reply [flat|nested] 3+ messages in thread
* SIOCETHTOOL history ?
@ 2003-05-06 12:37 arun
2003-05-06 11:49 ` David S. Miller
0 siblings, 1 reply; 3+ messages in thread
From: arun @ 2003-05-06 12:37 UTC (permalink / raw)
To: netdev
Hi,
Can anyone of the veterans please help me out with a
small code curiosity
Why does the SIOCETHTOOL ioctl need
CAP_NET_ADMIN even for harmless commands like
GSET ?
Some sample drivers that I managed to download over the net
that supports SIOCETHTOOL has comments like
"no need to check for CAP_NET_ADMIN since that is already
present in net/core/dev.c". (And sure enough it was there)
Why would such a blanket checking be present when this ioctl
is only an entry point for many sub commands ?
I have used SIOCGMIIPHY before and it seemed not to require
any su rights or capabilities. What's then the difference between these
2 ioctls that require more capabilities for SIOCETHTOOL ?
arun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: SIOCETHTOOL history ?
@ 2003-05-06 13:24 arun
0 siblings, 0 replies; 3+ messages in thread
From: arun @ 2003-05-06 13:24 UTC (permalink / raw)
To: netdev
----- Original Message -----
From: "arun" <akumar@omnesysindia.com>
To: "David S. Miller" <davem@redhat.com>
Sent: Tuesday, May 06, 2003 6:53 PM
Subject: Re: SIOCETHTOOL history ?
> ----- Original Message -----
> From: "David S. Miller" <davem@redhat.com>
> To: <akumar@omnesysindia.com>
> Cc: <netdev@oss.sgi.com>
> Sent: Tuesday, May 06, 2003 5:19 PM
> Subject: Re: SIOCETHTOOL history ?
>
> Yes it does:
Iam really stumped in that case since, mii-diag tool based
on Donald Beckers code, ftp://ftp.scyld.com/pub/diag/mii-diag.c
seems to work ok without CAP_NET_ADMIN on RH 7.1
and RH8.0 distros.
(I dont set any capabilities just tried to read speed / card id
and it never returned EPERM for me)
I chanced on the ethtool since mii failed to report anything on
newer Gigabit cards (specifically a Broadcom Corporation
NetXtreme BCM5701 card)
However ethtool required running with su root even for reading
the capabilities (I recompiled ethtool code with only a GSET
command to confirm this) and that is why i have this doubt on the
reason of the behavioural differnces between the 2 ioctl's
arun
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-06 13:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-06 13:24 SIOCETHTOOL history ? arun
-- strict thread matches above, loose matches on Subject: below --
2003-05-06 12:37 arun
2003-05-06 11:49 ` David S. Miller
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).