From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Subject: Re: xf86-video-intel hits an assert when using dri and xorg is not suid root Date: Fri, 13 Jun 2014 14:44:44 +0200 Message-ID: <539AF23C.6080106@redhat.com> References: <539AE9A6.8020601@redhat.com> <20140613123616.GG6451@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 2AAAD6E15B for ; Fri, 13 Jun 2014 05:44:50 -0700 (PDT) In-Reply-To: <20140613123616.GG6451@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org Hi, On 06/13/2014 02:36 PM, Chris Wilson wrote: > On Fri, Jun 13, 2014 at 02:08:06PM +0200, Hans de Goede wrote: >> Hi, >> >> When trying to run the latest xorg + intel drv, with dri3, with Xorg not >> running as root, the followin assert in src/intel_device.c: authorise() : >> >> assert(is_i915_gem(fd)); >> >> Triggers, this is caused by the DRM_IOCTL_I915_GETPARAM ioctl in >> is_i915_gem() failing with -EACCESS in this case. >> >> I thought that the use of rendernodes should work as normal user ? > > Hmm, I have > > DRM_IOCTL_DEF_DRV(I915_GETPARAM, i915_getparam, DRM_AUTH|DRM_RENDER_ALLOW), > > What path did find_render_node() choose? Was it right? I don't have USE_RENDERNODE defined in config.h, so find_render_node() is returning NULL, which makes dev->render_node point to dev->master_node, and thus makes intel_get_client_fd open the /dev/dri/card0 node a second time (when using non suid-root xorg the first time it was opened by systemd-logind and the fd was passed from systemd-logind to xf86-video-intel by the server). Do we really want a second open in this case, maybe intel_get_client_fd should detect that render_node == master_node and re-use the master fd in that case ? Regards, Hans