summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorThomas Hellstrom <unichrome@shipmail.org>2004-12-21 17:13:22 +0000
committerThomas Hellstrom <unichrome@shipmail.org>2004-12-21 17:13:22 +0000
commit02c35ec0a28b4fffcfc09ca444f7dc0c0912216d (patch)
tree988aa44f498d6251ad28d76663ec786e625537d1 /shared
parent47c178da08c01501890e23219cbac8319992a453 (diff)
via DRM: Tightened the security for some functions of the
DRM_IOCTL_VIA_DMA_INIT IOCTL. Bumped patchlevel and driver date. XFree86 bug: 2119
Diffstat (limited to 'shared')
-rw-r--r--shared/via.h4
-rw-r--r--shared/via_dma.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/shared/via.h b/shared/via.h
index 960f5e2d0..2811d7868 100644
--- a/shared/via.h
+++ b/shared/via.h
@@ -30,11 +30,11 @@
#define DRIVER_NAME "via"
#define DRIVER_DESC "VIA Unichrome"
-#define DRIVER_DATE "20041220"
+#define DRIVER_DATE "20041221"
#define DRIVER_MAJOR 2
#define DRIVER_MINOR 3
-#define DRIVER_PATCHLEVEL 2
+#define DRIVER_PATCHLEVEL 3
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_VIA_ALLOCMEM)] = { via_mem_alloc, 1, 0 }, \
diff --git a/shared/via_dma.c b/shared/via_dma.c
index a5c4b0a30..000d4b0ce 100644
--- a/shared/via_dma.c
+++ b/shared/via_dma.c
@@ -192,13 +192,20 @@ int via_dma_init(DRM_IOCTL_ARGS)
switch (init.func) {
case VIA_INIT_DMA:
- retcode = via_initialize(dev, dev_priv, &init);
+ if (!capable(CAP_SYS_ADMIN))
+ retcode = DRM_ERR(EPERM);
+ else
+ retcode = via_initialize(dev, dev_priv, &init);
break;
case VIA_CLEANUP_DMA:
- retcode = via_dma_cleanup(dev);
+ if (!capable(CAP_SYS_ADMIN))
+ retcode = DRM_ERR(EPERM);
+ else
+ retcode = via_dma_cleanup(dev);
break;
case VIA_DMA_INITIALIZED:
- retcode = (dev_priv->ring.virtual_start != NULL) ? 0: DRM_ERR( EFAULT );
+ retcode = (dev_priv->ring.virtual_start != NULL) ?
+ 0: DRM_ERR( EFAULT );
break;
default:
retcode = DRM_ERR(EINVAL);