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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Apr 2022 15:41:19 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Christoph Hellwig <hch@....de>
Cc:     Jani Nikula <jani.nikula@...ux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        Zhenyu Wang <zhenyuw@...ux.intel.com>,
        Zhi Wang <zhi.a.wang@...el.com>,
        intel-gfx@...ts.freedesktop.org,
        intel-gvt-dev@...ts.freedesktop.org,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 27/34] drm/i915/gvt: remove kvmgt_guest_{init,exit}

On Mon, Apr 11, 2022 at 04:13:56PM +0200, Christoph Hellwig wrote:
> Merge these into their only callers.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
>  drivers/gpu/drm/i915/gvt/kvmgt.c | 129 ++++++++++++++-----------------
>  1 file changed, 60 insertions(+), 69 deletions(-)

It is nice

Reviewed-by: Jason Gunthorpe <jgg@...dia.com>

> @@ -847,14 +873,37 @@ static int intel_vgpu_open_device(struct mdev_device *mdev)
>  		goto undo_group;
>  	}
>  
> -	ret = kvmgt_guest_init(mdev);
> -	if (ret)
> +	ret = -EEXIST;
> +	if (vgpu->attached)
> +		goto undo_group;
> +
> +	ret = -ESRCH;
> +	if (!vgpu->kvm || vgpu->kvm->mm != current->mm) {

For instance once all the obfuscation is stripped away it is easy to
see how the vgpu->kvm access here is unlocked against the notifier and
racy.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ