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: <4izjonpaqhkx6p3csfyxcjicgqahbmj2k6gupazehb3l7xhnvi@twlvpx2wc6ce>
Date: Thu, 17 Oct 2024 14:07:20 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Jeff Xu <jeffxu@...omium.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org,
        Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
        Jann Horn <jannh@...gle.com>, David Hildenbrand <david@...hat.com>,
        Qi Zheng <zhengqi.arch@...edance.com>,
        Kefeng Wang <wangkefeng.wang@...wei.com>,
        Pedro Falcato <pedro.falcato@...il.com>
Subject: Re: [PATCH 1/2] mm/mremap: Clean up vma_to_resize()

* Jeff Xu <jeffxu@...omium.org> [241017 13:55]:
> On Wed, Oct 16, 2024 at 1:17 PM Liam R. Howlett <Liam.Howlett@...cle.com> wrote:
> >
> > From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
> >
> > vma_to_resize() is used in two locations to find and validate the vma
> > for the mremap location.  One of the two locations already has the vma,
> > which is then re-found to validate the same vma.
> >
> > This code can be simplified by moving the vma_lookup() from
> > vma_to_resize() to mremap_to() and changing the return type to an int
> > error.
> >
> > Since the function now just validates the vma, the function is renamed
> > to mremap_vma_check() to better reflect what it is doing.
> >
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> > ---
> >  mm/mremap.c | 39 +++++++++++++++++++--------------------
> >  1 file changed, 19 insertions(+), 20 deletions(-)
> >
> > diff --git a/mm/mremap.c b/mm/mremap.c
> > index 5917feafe8cc..648c29f568af 100644
> > --- a/mm/mremap.c
> > +++ b/mm/mremap.c
> > @@ -826,17 +826,12 @@ static unsigned long move_vma(struct vm_area_struct *vma,
> >         return new_addr;
> >  }
> >
> > -static struct vm_area_struct *vma_to_resize(unsigned long addr,
> > +static int mremap_vma_check(struct vm_area_struct *vma, unsigned long addr,
> The original function is vma_to_resize, and mremap_vma_check is
> missing this context.
> Maybe mremap_vma_check_resize is a better name ?

Good point.  That suggestion is long though.  Perhaps
vma_check_resize(), since this is a static function in the mremap.c
file, it is fine to drop mremap from the name.

...

Thanks,
Liam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ