The code doesn't fully initialize the structure, which was extended to
include a flags member at some point.  Since the pending inteldrm
update uses that flags member, the DRM_IOCTL_I915_GEM_MMAP ioctl
starts randomly failing because the flags member contains stack
garbage.  The diff below fixes this.

Upstream has fixed this in a different way that is unfortunately
incompatible with the way we do ioctls on OpenBSD.

ok?


Index: driver/xf86-video-intel/src/sna/kgem.c
===================================================================
RCS file: /cvs/xenocara/driver/xf86-video-intel/src/sna/kgem.c,v
retrieving revision 1.4
diff -u -p -r1.4 kgem.c
--- driver/xf86-video-intel/src/sna/kgem.c      12 Apr 2015 19:42:06 -0000      
1.4
+++ driver/xf86-video-intel/src/sna/kgem.c      24 Jun 2017 00:56:02 -0000
@@ -6019,6 +6019,7 @@ retry:
        mmap_arg.handle = bo->handle;
        mmap_arg.offset = 0;
        mmap_arg.size = bytes(bo);
+       mmap_arg.flags = 0;
        if ((err = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))) {
                assert(err != EINVAL);
 

Reply via email to