diff options
| author | jakllsch <jakllsch@NetBSD.org> | 2023-01-05 18:29:45 +0000 |
|---|---|---|
| committer | jakllsch <jakllsch@NetBSD.org> | 2023-01-05 18:29:45 +0000 |
| commit | 7055aecf7766edbbddae67ee20b093951b87faf2 (patch) | |
| tree | b27f097beb63c801cdf71f1b0d3cf7fcb731a59e /sys/secmodel | |
| parent | 2574644d2f48af6d1fe9bf301b6f927b6644465b (diff) | |
wg(4): Allow non-root to retrieve information other than the private
key and the peer preshared key.
Add kauth(9) enums for wg(4) and add use them in suser secmodel.
Refines fix for PR 57161.
Diffstat (limited to 'sys/secmodel')
| -rw-r--r-- | sys/secmodel/suser/secmodel_suser.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/secmodel/suser/secmodel_suser.c b/sys/secmodel/suser/secmodel_suser.c index 0f64e7764a8..07cbcf0daa6 100644 --- a/sys/secmodel/suser/secmodel_suser.c +++ b/sys/secmodel/suser/secmodel_suser.c @@ -1,4 +1,4 @@ -/* $NetBSD: secmodel_suser.c,v 1.56 2023/01/05 17:36:53 jakllsch Exp $ */ +/* $NetBSD: secmodel_suser.c,v 1.57 2023/01/05 18:29:45 jakllsch Exp $ */ /*- * Copyright (c) 2006 Elad Efrat <elad@NetBSD.org> * All rights reserved. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.56 2023/01/05 17:36:53 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.57 2023/01/05 18:29:45 jakllsch Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -759,6 +759,20 @@ secmodel_suser_network_cb(kauth_cred_t cred, kauth_action_t action, break; + case KAUTH_NETWORK_INTERFACE_WG: + switch (req) { + case KAUTH_REQ_NETWORK_INTERFACE_WG_GETPRIV: + case KAUTH_REQ_NETWORK_INTERFACE_WG_SETPRIV: + if (isroot) + result = KAUTH_RESULT_ALLOW; + break; + + default: + break; + } + + break; + case KAUTH_NETWORK_SOCKET: switch (req) { case KAUTH_REQ_NETWORK_SOCKET_DROP: |
