summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2021-09-21 14:49:01 +0000
committerchristos <christos@NetBSD.org>2021-09-21 14:49:01 +0000
commitafe4b63deebbd88e3759442d88c692f2d98ffb37 (patch)
treeeb866df81ffc9b9da754252b5cce76bf7e123890 /sys
parent9799e8172592b6a9975809e57ecf44e532a023cf (diff)
don't opencode kauth_cred_get()
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/wi.c6
-rw-r--r--sys/dev/usb/if_umb.c8
-rw-r--r--sys/external/bsd/ipf/netinet/ip_nat.c11
-rw-r--r--sys/external/isc/atheros_hal/ic/ah_osdep.c6
-rw-r--r--sys/kern/kern_event.c8
5 files changed, 19 insertions, 20 deletions
diff --git a/sys/dev/ic/wi.c b/sys/dev/ic/wi.c
index 602ce27ce55..4b91cbc61a6 100644
--- a/sys/dev/ic/wi.c
+++ b/sys/dev/ic/wi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wi.c,v 1.256 2021/06/16 00:21:18 riastradh Exp $ */
+/* $NetBSD: wi.c,v 1.257 2021/09/21 14:50:12 christos Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.256 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.257 2021/09/21 14:50:12 christos Exp $");
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
@@ -1459,7 +1459,7 @@ wi_ioctl(struct ifnet *ifp, u_long cmd, void *data)
error = wi_get_cfg(ifp, cmd, data);
break;
case SIOCSIFGENERIC:
- error = kauth_authorize_network(curlwp->l_cred,
+ error = kauth_authorize_network(kauth_cred_get(),
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
NULL);
diff --git a/sys/dev/usb/if_umb.c b/sys/dev/usb/if_umb.c
index 1aead36ba7e..3c25df0d69f 100644
--- a/sys/dev/usb/if_umb.c
+++ b/sys/dev/usb/if_umb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_umb.c,v 1.20 2021/06/16 00:21:19 riastradh Exp $ */
+/* $NetBSD: if_umb.c,v 1.21 2021/09/21 14:49:01 christos Exp $ */
/* $OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
/*
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.20 2021/06/16 00:21:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.21 2021/09/21 14:49:01 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -773,7 +773,7 @@ umb_ioctl(struct ifnet *ifp, u_long cmd, void *data)
usb_add_task(sc->sc_udev, &sc->sc_umb_task, USB_TASKQ_DRIVER);
break;
case SIOCGUMBINFO:
- error = kauth_authorize_network(curlwp->l_cred,
+ error = kauth_authorize_network(kauth_cred_get(),
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
NULL);
@@ -783,7 +783,7 @@ umb_ioctl(struct ifnet *ifp, u_long cmd, void *data)
sizeof(sc->sc_info));
break;
case SIOCSUMBPARAM:
- error = kauth_authorize_network(curlwp->l_cred,
+ error = kauth_authorize_network(kauth_cred_get(),
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd),
NULL);
diff --git a/sys/external/bsd/ipf/netinet/ip_nat.c b/sys/external/bsd/ipf/netinet/ip_nat.c
index f18a497b6fc..508b05051c8 100644
--- a/sys/external/bsd/ipf/netinet/ip_nat.c
+++ b/sys/external/bsd/ipf/netinet/ip_nat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_nat.c,v 1.24 2021/05/26 14:48:02 christos Exp $ */
+/* $NetBSD: ip_nat.c,v 1.25 2021/09/21 14:50:53 christos Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
@@ -112,7 +112,7 @@ extern struct ifnet vpnif;
#if !defined(lint)
#if defined(__NetBSD__)
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.24 2021/05/26 14:48:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.25 2021/09/21 14:50:53 christos Exp $");
#else
static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ip_nat.c,v 1.1.1.2 2012/07/22 13:45:27 darrenr Exp";
@@ -988,10 +988,9 @@ ipf_nat_ioctl(ipf_main_softc_t *softc, void *data, ioctlcmd_t cmd, int mode,
#if BSD_GE_YEAR(199306) && defined(_KERNEL)
# if NETBSD_GE_REV(399002000)
- if ((mode & FWRITE) &&
- kauth_authorize_network(curlwp->l_cred, KAUTH_NETWORK_FIREWALL,
- KAUTH_REQ_NETWORK_FIREWALL_FW,
- NULL, NULL, NULL))
+ if ((mode & FWRITE) && kauth_authorize_network(
+ kauth_cred_get(), KAUTH_NETWORK_FIREWALL,
+ KAUTH_REQ_NETWORK_FIREWALL_FW, NULL, NULL, NULL))
# else
# if defined(__FreeBSD_version) && (__FreeBSD_version >= 500034)
if (securelevel_ge(curthread->td_ucred, 3) && (mode & FWRITE))
diff --git a/sys/external/isc/atheros_hal/ic/ah_osdep.c b/sys/external/isc/atheros_hal/ic/ah_osdep.c
index 919506a2c04..91dce966b04 100644
--- a/sys/external/isc/atheros_hal/ic/ah_osdep.c
+++ b/sys/external/isc/atheros_hal/ic/ah_osdep.c
@@ -26,11 +26,11 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: ah_osdep.c,v 1.6 2012/04/11 13:48:11 nakayama Exp $
+ * $Id: ah_osdep.c,v 1.7 2021/09/21 14:51:28 christos Exp $
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ah_osdep.c,v 1.6 2012/04/11 13:48:11 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ah_osdep.c,v 1.7 2021/09/21 14:51:28 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_athhal.h"
@@ -211,7 +211,7 @@ ath_hal_setlogging(int enable)
int error;
if (enable) {
- error = kauth_authorize_network(curlwp->l_cred,
+ error = kauth_authorize_network(kauth_cred_get(),
KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, NULL, NULL, NULL);
if (error == 0) {
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index ba11eec9f2e..84e0497cdf3 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_event.c,v 1.118 2021/05/02 19:13:43 jdolecek Exp $ */
+/* $NetBSD: kern_event.c,v 1.119 2021/09/21 14:52:40 christos Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.118 2021/05/02 19:13:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.119 2021/09/21 14:52:40 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -546,8 +546,8 @@ filt_procattach(struct knote *kn)
*/
mutex_enter(p->p_lock);
mutex_exit(&proc_lock);
- if (kauth_authorize_process(curl->l_cred, KAUTH_PROCESS_KEVENT_FILTER,
- p, NULL, NULL, NULL) != 0) {
+ if (kauth_authorize_process(curl->l_proc, curl->l_cred,
+ KAUTH_PROCESS_KEVENT_FILTER, p, NULL, NULL, NULL) != 0) {
mutex_exit(p->p_lock);
return EACCES;
}