summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2005-03-08 23:47:11 +0000
committerDave Airlie <airlied@linux.ie>2005-03-08 23:47:11 +0000
commit7d3c42b58940b56efa9bfc13a08b5e67797fc771 (patch)
tree14a5de8305f15e79224bb504113fcd6793bbdea8 /linux-core
parent95fa851769b2a3461fb710f6d035bc5b2bf164e0 (diff)
Fix for bug 2673 from Egbert Eich - memset the version
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_ioctl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/linux-core/drm_ioctl.c b/linux-core/drm_ioctl.c
index b8ed5a70..24f6579f 100644
--- a/linux-core/drm_ioctl.c
+++ b/linux-core/drm_ioctl.c
@@ -328,6 +328,14 @@ int drm_setversion(DRM_IOCTL_ARGS)
DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv));
+ /*
+ * version.name etc need to be initialized to zero.
+ * If we don't, driver->version() will poke random strings to
+ * random locations in user space, causing X server segfaults
+ * that are interesting to debug. --eich
+ */
+ memset(&version, 0, sizeof(version));
+
dev->driver->version(&version);
retv.drm_di_major = DRM_IF_MAJOR;
retv.drm_di_minor = DRM_IF_MINOR;