diff options
author | Thomas Hellstrom <unichrome@shipmail.org> | 2004-12-21 17:13:22 +0000 |
---|---|---|
committer | Thomas Hellstrom <unichrome@shipmail.org> | 2004-12-21 17:13:22 +0000 |
commit | 02c35ec0a28b4fffcfc09ca444f7dc0c0912216d (patch) | |
tree | 988aa44f498d6251ad28d76663ec786e625537d1 /shared/via_dma.c | |
parent | 47c178da08c01501890e23219cbac8319992a453 (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/via_dma.c')
-rw-r--r-- | shared/via_dma.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/shared/via_dma.c b/shared/via_dma.c index a5c4b0a3..000d4b0c 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); |