lkml.org 
[lkml]   [2013]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] drm/nouveau: fix nested locking in mmap handler

* Maarten Lankhorst <maarten.lankhorst@canonical.com> wrote:

> > I think the Nouveau guys need to comment further on this, but
> > returning -EFAULT might break existing user-space, and that's not
> > allowed, but IIRC the return value of "presumed" is only a hint, and
> > if it's incorrect will only trigger future command stream patching.
> >
> > Otherwise reviewing mostly the TTM stuff. FWIW, from wat I can tell
> > the vmwgfx driver doesn't need any fixups.
>
> Well because we read the list of buffer objects the presumed offsets are
> at least read-mapped. Although I guess in the worst case the mapping
> might disappear before the syscall copies back the data. So if -EFAULT
> happens here then userspace messed up in some way, either by forgetting
> to map the offsets read-write, which cannot happen with libdrm or
> free'ing the bo list before the syscall returns, which would probably
> result in libdrm crashing shortly afterwards anyway.
>
> So I don't know whether to swallow that -EFAULT or not, which is what I
> asked.

In such a case returning -EFAULT is very strongly preferred.

If there's a user-space bug, such as a context life time race between
graphics context creation/destruction and user threads making use of the
graphics context, then getting the -EFAULT would be very helpful to
user-space debugging as well.

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-09-24 10:41    [W:0.120 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site