lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1277b18e-9a19-fd0c-41fc-4923bcd772fd@gmail.com>
Date:   Fri, 15 Jan 2021 17:03:18 +0000
From:   Jinoh Kang <jinoh.kang.kr@...il.com>
To:     Chris Wilson <chris@...is-wilson.co.uk>,
        Marek Marczykowski-Górecki 
        <marmarek@...isiblethingslab.com>
Cc:     Jani Nikula <jani.nikula@...ux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Matthew Auld <matthew.auld@...el.com>,
        intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/i915/userptr: detect un-GUP-able pages early

On 1/15/21 4:56 PM, Chris Wilson wrote:
> Quoting Jinoh Kang (2021-01-15 16:23:31)
>> If GUP-ineligible pages are passed to a GEM userptr object, -EFAULT is
>> returned only when the object is actually bound.
>>
>> The xf86-video-intel userspace driver cannot differentiate this
>> condition, and marks the GPU as wedged.
> 
> The idea was to call gem_set_domain on the object to validate the pages
> after creation. I only did that for read-only... I did however make mesa
> use set-domain for validation.

Thanks for the info!

> 
> As a question how are you getting to call userptr on something that
> wasn't passed by SHM ipc?

Basically XShmAttachFd, which is not exposed on libX11.

> 
>> This not only disables graphics
>> acceleration but may also cripple other functions such as VT switch.
> 
> That should be a non-sequitur; certainly VT switch works without ever
> using the GPU.

Not that VT switch doesn't work; rather, there's some heavy graphic
artifacts such as blank rectangles or part of window going completely
transparent.  I suppose that's another issue.

> 
>> Solve this by "prefaulting" user pages on GEM object creation, testing
>> whether all pages are eligible for get_user_pages() in the process.
>> On failure, return -EFAULT so that userspace can fallback to software
>> blitting.
> 
> See https://patchwork.freedesktop.org/series/33449/ for adding PROBE |
> POPULATE flags.
> 
> But we can just use set-domain.

So this patch was unnecessary.  Thanks for the pointer as to how to
patch the userspace.

> -Chris
> 

-- 
Sincerely,
Jinoh Kang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ