Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci use KAUTH_MACHDEP_UNMANAGEDMEM instead of KAUTH_...
details: https://anonhg.NetBSD.org/src/rev/9fd524bf7658
branches: trunk
changeset: 1023668:9fd524bf7658
user: christos <christos%NetBSD.org@localhost>
date: Tue Sep 21 14:47:28 2021 +0000
description:
use KAUTH_MACHDEP_UNMANAGEDMEM instead of KAUTH_GENERIC_ISSUSER like all the
other framebuffers.
diffstat:
sys/dev/pci/sisfb.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diffs (29 lines):
diff -r dc0843340d5c -r 9fd524bf7658 sys/dev/pci/sisfb.c
--- a/sys/dev/pci/sisfb.c Tue Sep 21 14:40:14 2021 +0000
+++ b/sys/dev/pci/sisfb.c Tue Sep 21 14:47:28 2021 +0000
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.7 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.8 2021/09/21 14:47:28 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -472,10 +472,13 @@
}
return -1;
}
- if (kauth_authorize_generic(kauth_cred_get(), KAUTH_GENERIC_ISSUSER,
- NULL) != 0) {
+
+ if (kauth_authorize_machdep(kauth_cred_get(),
+ KAUTH_MACHDEP_UNMANAGEDMEM, NULL, NULL, NULL, NULL) != 0) {
+ aprint_error_dev(sc->sc_dev, "mmap() rejected.\n");
return -1;
- }
+ }
+
if (offset >= (fb->fbbase & ~PAGE_MASK) &&
offset <= ((fb->fbbase + fb->fbsize + PAGE_SIZE - 1) & ~PAGE_MASK)) {
pa = bus_space_mmap(fb->fbt, fb->fbbase, offset - fb->fbbase,
Home |
Main Index |
Thread Index |
Old Index