Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Introduce KAUTH_REQ_PROCESS_CANSEE_KPTR, and use it in t...
details: https://anonhg.NetBSD.org/src/rev/59fecc680fbb
branches: trunk
changeset: 835696:59fecc680fbb
user: maxv <maxv%NetBSD.org@localhost>
date: Tue Sep 04 14:31:18 2018 +0000
description:
Introduce KAUTH_REQ_PROCESS_CANSEE_KPTR, and use it in the already-existing
modstat code. No real functional change.
diffstat:
sys/kern/kern_proc.c | 5 +++--
sys/kern/sys_module.c | 8 ++++----
sys/secmodel/extensions/secmodel_extensions.c | 5 +++--
sys/secmodel/suser/secmodel_suser.c | 5 +++--
sys/sys/kauth.h | 3 ++-
5 files changed, 15 insertions(+), 11 deletions(-)
diffs (124 lines):
diff -r 61a6f8462192 -r 59fecc680fbb sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c Tue Sep 04 06:40:37 2018 +0000
+++ b/sys/kern/kern_proc.c Tue Sep 04 14:31:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_proc.c,v 1.214 2018/09/03 16:29:35 riastradh Exp $ */
+/* $NetBSD: kern_proc.c,v 1.215 2018/09/04 14:31:18 maxv Exp $ */
/*-
* Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.214 2018/09/03 16:29:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.215 2018/09/04 14:31:18 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_kstack.h"
@@ -278,6 +278,7 @@
break;
+ case KAUTH_REQ_PROCESS_CANSEE_KPTR:
default:
break;
}
diff -r 61a6f8462192 -r 59fecc680fbb sys/kern/sys_module.c
--- a/sys/kern/sys_module.c Tue Sep 04 06:40:37 2018 +0000
+++ b/sys/kern/sys_module.c Tue Sep 04 14:31:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_module.c,v 1.24 2018/09/03 16:29:35 riastradh Exp $ */
+/* $NetBSD: sys_module.c,v 1.25 2018/09/04 14:31:18 maxv Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.24 2018/09/03 16:29:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.25 2018/09/04 14:31:18 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_modular.h"
@@ -123,8 +123,8 @@
bool stataddr;
/* If not privileged, don't expose kernel addresses. */
- error = kauth_authorize_system(kauth_cred_get(), KAUTH_SYSTEM_MODULE,
- 0, (void *)(uintptr_t)MODCTL_STAT, NULL, NULL);
+ error = kauth_authorize_process(kauth_cred_get(), KAUTH_PROCESS_CANSEE,
+ curproc, KAUTH_ARG(KAUTH_REQ_PROCESS_CANSEE_KPTR), NULL, NULL);
stataddr = (error == 0);
kernconfig_lock();
diff -r 61a6f8462192 -r 59fecc680fbb sys/secmodel/extensions/secmodel_extensions.c
--- a/sys/secmodel/extensions/secmodel_extensions.c Tue Sep 04 06:40:37 2018 +0000
+++ b/sys/secmodel/extensions/secmodel_extensions.c Tue Sep 04 14:31:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_extensions.c,v 1.9 2018/08/25 09:54:37 maxv Exp $ */
+/* $NetBSD: secmodel_extensions.c,v 1.10 2018/09/04 14:31:19 maxv Exp $ */
/*-
* Copyright (c) 2011 Elad Efrat <elad%NetBSD.org@localhost>
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: secmodel_extensions.c,v 1.9 2018/08/25 09:54:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_extensions.c,v 1.10 2018/09/04 14:31:19 maxv Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -450,6 +450,7 @@
break;
+ case KAUTH_REQ_PROCESS_CANSEE_KPTR:
default:
break;
}
diff -r 61a6f8462192 -r 59fecc680fbb sys/secmodel/suser/secmodel_suser.c
--- a/sys/secmodel/suser/secmodel_suser.c Tue Sep 04 06:40:37 2018 +0000
+++ b/sys/secmodel/suser/secmodel_suser.c Tue Sep 04 14:31:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_suser.c,v 1.47 2018/08/25 09:54:37 maxv Exp $ */
+/* $NetBSD: secmodel_suser.c,v 1.48 2018/09/04 14:31:19 maxv Exp $ */
/*-
* Copyright (c) 2006 Elad Efrat <elad%NetBSD.org@localhost>
* All rights reserved.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.47 2018/08/25 09:54:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.48 2018/09/04 14:31:19 maxv Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -500,6 +500,7 @@
case KAUTH_REQ_PROCESS_CANSEE_ENTRY:
case KAUTH_REQ_PROCESS_CANSEE_OPENFILES:
case KAUTH_REQ_PROCESS_CANSEE_EPROC:
+ case KAUTH_REQ_PROCESS_CANSEE_KPTR:
if (isroot) {
result = KAUTH_RESULT_ALLOW;
break;
diff -r 61a6f8462192 -r 59fecc680fbb sys/sys/kauth.h
--- a/sys/sys/kauth.h Tue Sep 04 06:40:37 2018 +0000
+++ b/sys/sys/kauth.h Tue Sep 04 14:31:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kauth.h,v 1.79 2018/08/25 09:54:37 maxv Exp $ */
+/* $NetBSD: kauth.h,v 1.80 2018/09/04 14:31:18 maxv Exp $ */
/*-
* Copyright (c) 2005, 2006 Elad Efrat <elad%NetBSD.org@localhost>
@@ -231,6 +231,7 @@
KAUTH_REQ_PROCESS_RLIMIT_SET,
KAUTH_REQ_PROCESS_RLIMIT_BYPASS,
KAUTH_REQ_PROCESS_CANSEE_EPROC,
+ KAUTH_REQ_PROCESS_CANSEE_KPTR
};
/*
Home |
Main Index |
Thread Index |
Old Index