From 7d3c42b58940b56efa9bfc13a08b5e67797fc771 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 8 Mar 2005 23:47:11 +0000 Subject: Fix for bug 2673 from Egbert Eich - memset the version --- linux-core/drm_ioctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- cgit v1.2.3