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, 14 Jan 2019 18:31:12 -0500
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Souptick Joarder <jrdr.linux@...il.com>, akpm@...ux-foundation.org,
        willy@...radead.org, mhocko@...e.com, jgross@...e.com,
        linux@...linux.org.uk, robin.murphy@....com
Cc:     xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [PATCH 9/9] xen/privcmd-buf.c: Convert to use
 vm_insert_range_buggy

On 1/11/19 10:13 AM, Souptick Joarder wrote:
> Convert to use vm_insert_range_buggy() to map range of kernel
> memory to user vma.
>
> This driver has ignored vm_pgoff. We could later "fix" these drivers
> to behave according to the normal vm_pgoff offsetting simply by
> removing the _buggy suffix on the function name and if that causes
> regressions, it gives us an easy way to revert.
>
> Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
> ---
>  drivers/xen/privcmd-buf.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/xen/privcmd-buf.c b/drivers/xen/privcmd-buf.c
> index de01a6d..a9d7e97 100644
> --- a/drivers/xen/privcmd-buf.c
> +++ b/drivers/xen/privcmd-buf.c
> @@ -166,12 +166,8 @@ static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma)
>  	if (vma_priv->n_pages != count)
>  		ret = -ENOMEM;
>  	else
> -		for (i = 0; i < vma_priv->n_pages; i++) {
> -			ret = vm_insert_page(vma, vma->vm_start + i * PAGE_SIZE,
> -					     vma_priv->pages[i]);
> -			if (ret)
> -				break;
> -		}
> +		ret = vm_insert_range_buggy(vma, vma_priv->pages,
> +						vma_priv->n_pages);

This can use the non-buggy version. But since the original code was
indeed buggy in this respect I can submit this as a separate patch later.

So

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>


>  
>  	if (ret)
>  		privcmd_buf_vmapriv_free(vma_priv);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ