Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/drm Apply access control to gem mmap.
details: https://anonhg.NetBSD.org/src/rev/3a9d9d9bddb2
branches: trunk
changeset: 336661:3a9d9d9bddb2
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Mar 09 01:29:40 2015 +0000
description:
Apply access control to gem mmap.
diffstat:
sys/external/bsd/drm2/drm/drm_gem_vm.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r 3d7efc556b7e -r 3a9d9d9bddb2 sys/external/bsd/drm2/drm/drm_gem_vm.c
--- a/sys/external/bsd/drm2/drm/drm_gem_vm.c Mon Mar 09 01:07:27 2015 +0000
+++ b/sys/external/bsd/drm2/drm/drm_gem_vm.c Mon Mar 09 01:29:40 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_gem_vm.c,v 1.5 2014/07/26 21:15:45 riastradh Exp $ */
+/* $NetBSD: drm_gem_vm.c,v 1.6 2015/03/09 01:29:40 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_gem_vm.c,v 1.5 2014/07/26 21:15:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem_vm.c,v 1.6 2015/03/09 01:29:40 riastradh Exp $");
#include <sys/types.h>
@@ -95,7 +95,7 @@
static int
drm_gem_mmap_object_locked(struct drm_device *dev, off_t byte_offset,
size_t nbytes, int prot __unused, struct uvm_object **uobjp,
- voff_t *uoffsetp, struct file *file __unused)
+ voff_t *uoffsetp, struct file *file)
{
const unsigned long startpage = (byte_offset >> PAGE_SHIFT);
const unsigned long npages = (nbytes >> PAGE_SHIFT);
@@ -118,6 +118,9 @@
return 0;
}
+ if (!drm_vma_node_is_allowed(node, file))
+ return -EACCES;
+
struct drm_gem_object *const obj = container_of(node,
struct drm_gem_object, vma_node);
KASSERT(obj->dev == dev);
Home |
Main Index |
Thread Index |
Old Index