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:   Tue, 18 Jan 2022 00:01:36 +0000
From:   Liam Howlett <liam.howlett@...cle.com>
To:     Vlastimil Babka <vbabka@...e.cz>
CC:     "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Song Liu <songliubraving@...com>,
        Davidlohr Bueso <dave@...olabs.net>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Matthew Wilcox <willy@...radead.org>,
        Laurent Dufour <ldufour@...ux.ibm.com>,
        David Rientjes <rientjes@...gle.com>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Rik van Riel <riel@...riel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Michel Lespinasse <walken.cr@...il.com>,
        Jerome Glisse <jglisse@...hat.com>,
        Minchan Kim <minchan@...gle.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Rom Lemarchand <romlem@...gle.com>
Subject: Re: [PATCH v4 18/66] xen: Use vma_lookup() in privcmd_ioctl_mmap()

* Vlastimil Babka <vbabka@...e.cz> [220112 11:01]:
> On 12/1/21 15:29, Liam Howlett wrote:
> > From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
> > 
> > vma_lookup() walks the VMA tree for a specific value, find_vma() will
> > search the tree after walking to a specific value.  It is more efficient
> > to only walk to the requested value as this case requires the address to
> > equal the vm_start.
> 
> By that you mean the privcmd_ioctl_mmap() code checks msg->va !=
> vma->vm_start and thus we know it's never interested the next vma, that
> find_vma() can return if no vma covers the address?

Yes.  I will reword the commit message.

> 
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> 
> Acked-by: Vlastimil Babka <vbabka@...e.cz>
> 
> > ---
> >  drivers/xen/privcmd.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> > index 3369734108af..ad17166b0ef6 100644
> > --- a/drivers/xen/privcmd.c
> > +++ b/drivers/xen/privcmd.c
> > @@ -282,7 +282,7 @@ static long privcmd_ioctl_mmap(struct file *file, void __user *udata)
> >  						     struct page, lru);
> >  		struct privcmd_mmap_entry *msg = page_address(page);
> >  
> > -		vma = find_vma(mm, msg->va);
> > +		vma = vma_lookup(mm, msg->va);
> >  		rc = -EINVAL;
> >  
> >  		if (!vma || (msg->va != vma->vm_start) || vma->vm_private_data)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ