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>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 22 Nov 2019 10:33:38 -0600
From:   Rob Herring <robh@...nel.org>
To:     Gerd Hoffmann <kraxel@...hat.com>
Cc:     dri-devel <dri-devel@...ts.freedesktop.org>,
        Intel Graphics <intel-gfx@...ts.freedesktop.org>,
        Daniel Vetter <daniel.vetter@...ll.ch>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Christian Koenig <christian.koenig@....com>,
        Huang Rui <ray.huang@....com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] drm: call drm_gem_object_funcs.mmap with fake offset

On Fri, Nov 22, 2019 at 12:37 AM Gerd Hoffmann <kraxel@...hat.com> wrote:
>
> The fake offset is going to stay, so change the calling convention for
> drm_gem_object_funcs.mmap to include the fake offset.  Update all users
> accordingly.
>
> Note that this reverts 83b8a6f242ea ("drm/gem: Fix mmap fake offset
> handling for drm_gem_object_funcs.mmap") and on top then adds the fake
> offset to  drm_gem_prime_mmap to make sure all paths leading to
> obj->funcs->mmap are consistent.

IOW, v1 of my original fix. :) Though you did it a little differently:

> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> index 0814211b0f3f..a9633bd241bb 100644
> --- a/drivers/gpu/drm/drm_prime.c
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -714,6 +714,9 @@ int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
>         int ret;
>
>         if (obj->funcs && obj->funcs->mmap) {
> +               /* Add the fake offset */
> +               vma->vm_pgoff += drm_vma_node_start(&obj->vma_node);
> +

Can't this be moved out of the if and then the same thing later down
removed? Unless there's some requirement that drm_vma_node_allow() be
called before drm_vma_node_start() in that case. Doesn't look like it
to me, but I'm not really sure.

>                 ret = obj->funcs->mmap(obj, vma);
>                 if (ret)
>                         return ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ