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]
Message-ID: <35654e1a-d066-0581-749f-7e3b65023988@oracle.com>
Date:   Tue, 5 Mar 2019 08:43:38 -0500
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Arnd Bergmann <arnd@...db.de>, Juergen Gross <jgross@...e.com>
Cc:     Stefano Stabellini <sstabellini@...nel.org>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>,
        Paul Durrant <paul.durrant@...rix.com>,
        linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org
Subject: Re: [PATCH] [v2] xen: avoid link error on ARM

On 3/5/19 8:30 AM, Arnd Bergmann wrote:
>  
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index b24ddac1604b..290b6aca7e1d 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -723,26 +723,6 @@ static long privcmd_ioctl_restrict(struct file *file, void __user *udata)
>  	return 0;
>  }
>  
> -struct remap_pfn {
> -	struct mm_struct *mm;
> -	struct page **pages;
> -	pgprot_t prot;
> -	unsigned long i;
> -};
> -
> -static int remap_pfn_fn(pte_t *ptep, pgtable_t token, unsigned long addr,
> -			void *data)
> -{
> -	struct remap_pfn *r = data;
> -	struct page *page = r->pages[r->i];
> -	pte_t pte = pte_mkspecial(pfn_pte(page_to_pfn(page), r->prot));
> -
> -	set_pte_at(r->mm, addr, ptep, pte);
> -	r->i++;
> -
> -	return 0;
> -}
> -
>  static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata)
>  {
>  	struct privcmd_data *data = file->private_data;
> @@ -809,15 +789,7 @@ static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata)
>  		goto out;
>  
>  	if (xen_feature(XENFEAT_auto_translated_physmap)) {
> -		struct remap_pfn r = {
> -			.mm = vma->vm_mm,
> -			.pages = vma->vm_private_data,
> -			.prot = vma->vm_page_prot,
> -		};
> -
> -		rc = apply_to_page_range(r.mm, kdata.addr,
> -					 kdata.num << PAGE_SHIFT,
> -					 remap_pfn_fn, &r);
> +		rc = xen_remap_vma_range(vma, kdata.addr, kdata.num << PAGE_SHIFT);

I wonder whether drivers/xen/xlate_mmu.c might be a good place for these
routines.

-boris

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ