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: <20241017140813.fe555ec947b17dd035e4c0d7@linux-foundation.org>
Date: Thu, 17 Oct 2024 14:08:13 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jeff Xu <jeffxu@...omium.org>
Cc: "Liam R. Howlett" <Liam.Howlett@...cle.com>, 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()

On Thu, 17 Oct 2024 11:15:20 -0700 Jeff Xu <jeffxu@...omium.org> wrote:

> > > > -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.
> >
> I'm ok with that.

Any function with "check" in the name makes my teeth ache.  "check"
what?  And the name doesn't carry any connotation of the return value's
meaning.

eg, "check_the_cheese()" versus "cheese_is_fresh()".  The latter name
tells you what is being checked and it tells you what a "true" return
value means.

Also, the dang function isn't documented.

Also, why is mremap_to() calling mremap_vma_check() without testing its
return value?  mremap_vma_check() doesn't actually alter anything, does
it?  If it does then it's misnamed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ