Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Don't kauth-orize SIOCSIFMTU in pppsioctl() and stf_...



details:   https://anonhg.NetBSD.org/src/rev/792987a6fc4e
branches:  trunk
changeset: 770669:792987a6fc4e
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Fri Oct 28 20:13:32 2011 +0000

description:
Don't kauth-orize SIOCSIFMTU in pppsioctl() and stf_ioctl(), ifioctl()
has already done that for us.

diffstat:

 sys/net/if_ppp.c |  11 ++---------
 sys/net/if_stf.c |  12 ++----------
 2 files changed, 4 insertions(+), 19 deletions(-)

diffs (86 lines):

diff -r 36e127f1b567 -r 792987a6fc4e sys/net/if_ppp.c
--- a/sys/net/if_ppp.c  Fri Oct 28 20:11:58 2011 +0000
+++ b/sys/net/if_ppp.c  Fri Oct 28 20:13:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ppp.c,v 1.134 2011/08/07 13:51:37 rmind Exp $       */
+/*     $NetBSD: if_ppp.c,v 1.135 2011/10/28 20:13:32 dyoung Exp $      */
 /*     Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp       */
 
 /*
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.134 2011/08/07 13:51:37 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.135 2011/10/28 20:13:32 dyoung Exp $");
 
 #include "ppp.h"
 
@@ -734,7 +734,6 @@
 static int
 pppsioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
-    struct lwp *l = curlwp;    /* XXX */
     struct ppp_softc *sc = ifp->if_softc;
     struct ifaddr *ifa = (struct ifaddr *)data;
     struct ifreq *ifr = (struct ifreq *)data;
@@ -834,12 +833,6 @@
        break;
 #endif /* PPP_COMPRESS */
 
-    case SIOCSIFMTU:
-       if ((error = kauth_authorize_network(l->l_cred,
-           KAUTH_NETWORK_INTERFACE, KAUTH_REQ_NETWORK_INTERFACE_SETPRIV,
-           ifp, (void *)cmd, NULL)) != 0)
-           break;
-       /*FALLTHROUGH*/
     default:
        if ((error = ifioctl_common(&sc->sc_if, cmd, data)) == ENETRESET)
                error = 0;
diff -r 36e127f1b567 -r 792987a6fc4e sys/net/if_stf.c
--- a/sys/net/if_stf.c  Fri Oct 28 20:11:58 2011 +0000
+++ b/sys/net/if_stf.c  Fri Oct 28 20:13:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_stf.c,v 1.76 2011/07/17 20:54:52 joerg Exp $        */
+/*     $NetBSD: if_stf.c,v 1.77 2011/10/28 20:13:32 dyoung Exp $       */
 /*     $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
 
 /*
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.76 2011/07/17 20:54:52 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.77 2011/10/28 20:13:32 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -90,7 +90,6 @@
 #include <sys/protosw.h>
 #include <sys/queue.h>
 #include <sys/syslog.h>
-#include <sys/kauth.h>
 
 #include <sys/cpu.h>
 
@@ -661,7 +660,6 @@
 static int
 stf_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
-       struct lwp              *l = curlwp;    /* XXX */
        struct ifaddr           *ifa;
        struct ifreq            *ifr = data;
        struct sockaddr_in6     *sin6;
@@ -694,12 +692,6 @@
                break;
 
        case SIOCSIFMTU:
-               error = kauth_authorize_network(l->l_cred,
-                   KAUTH_NETWORK_INTERFACE,
-                   KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
-                   NULL);
-               if (error)
-                       break;
                if (ifr->ifr_mtu < STF_MTU_MIN || ifr->ifr_mtu > STF_MTU_MAX)
                        return EINVAL;
                else if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)



Home | Main Index | Thread Index | Old Index