Module Name: src
Committed By: martin
Date: Tue Dec 17 16:18:50 UTC 2019
Modified Files:
src/sys/dev/ic [netbsd-8]: ath.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #1475):
sys/dev/ic/ath.c: revision 1.129
Protect network ioctls from non-authorized users. (Ilja Van Sprundel)
To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.123.6.1 src/sys/dev/ic/ath.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/ath.c
diff -u src/sys/dev/ic/ath.c:1.123 src/sys/dev/ic/ath.c:1.123.6.1
--- src/sys/dev/ic/ath.c:1.123 Thu Feb 2 10:05:35 2017
+++ src/sys/dev/ic/ath.c Tue Dec 17 16:18:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ath.c,v 1.123 2017/02/02 10:05:35 nonaka Exp $ */
+/* $NetBSD: ath.c,v 1.123.6.1 2019/12/17 16:18:50 martin Exp $ */
/*-
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
#endif
#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.123 2017/02/02 10:05:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.123.6.1 2019/12/17 16:18:50 martin Exp $");
#endif
/*
@@ -69,6 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.12
#include <sys/callout.h>
#include <sys/bus.h>
#include <sys/endian.h>
+#include <sys/kauth.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -5435,6 +5436,12 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
return copyout(&sc->sc_stats,
ifr->ifr_data, sizeof (sc->sc_stats));
case SIOCGATHDIAG:
+ error = kauth_authorize_network(curlwp->l_cred,
+ KAUTH_NETWORK_INTERFACE,
+ KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
+ NULL);
+ if (error)
+ break;
error = ath_ioctl_diag(sc, (struct ath_diag *) ifr);
break;
default: