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: <a7dad10b-11e9-46e0-a21d-5862a0167ed8@lucifer.local>
Date: Fri, 20 Jun 2025 19:01:19 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: SeongJae Park <sj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>, Zi Yan <ziy@...dia.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        "Liam R . Howlett" <Liam.Howlett@...cle.com>,
        Nico Pache <npache@...hat.com>, Ryan Roberts <ryan.roberts@....com>,
        Dev Jain <dev.jain@....com>, Barry Song <baohua@...nel.org>,
        Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Lance Yang <ioworker0@...il.com>,
        Suren Baghdasaryan <surenb@...gle.com>
Subject: Re: [PATCH v2 4/5] mm/madvise: thread all madvise state through
 madv_behavior

On Fri, Jun 20, 2025 at 10:56:22AM -0700, SeongJae Park wrote:
> On Fri, 20 Jun 2025 16:33:04 +0100 Lorenzo Stoakes <lorenzo.stoakes@...cle.com> wrote:
>
> > Doing so means we can get rid of all the weird struct vm_area_struct **prev
> > stuff, everything becomes consistent and in future if we want to make
> > change to behaviour there's a single place where all relevant state is
> > stored.
> >
> > This also allows us to update try_vma_read_lock() to be a little more
> > succinct and set up state for us, as well as cleaning up
> > madvise_update_vma().
> >
> > We also update the debug assertion prior to madvise_update_vma() to assert
> > that this is a write operation as correctly pointed out by Barry in the
> > relevant thread.
> >
> > We can't reasonably update the madvise functions that live outside of
> > mm/madvise.c so we leave those as-is.
> >
> > Acked-by: Zi Yan <ziy@...dia.com>
> > Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
> > Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
>
> Found a very trivial nit below.  Other than that,
>
> Reviewed-by: SeongJae Park <sj@...nel.org>

Thanks! And also for other tags of course :)

>
> [...]
> > @@ -1607,23 +1615,19 @@ int madvise_walk_vmas(struct madvise_behavior *madv_behavior)
> >  	struct madvise_behavior_range *range = &madv_behavior->range;
> >  	/* range is updated to span each VMA, so store end of entire range. */
> >  	unsigned long last_end = range->end;
> > -	struct vm_area_struct *vma;
> > -	struct vm_area_struct *prev;
> >  	int unmapped_error = 0;
> >  	int error;
> > +	struct vm_area_struct *vma;
>
> A very trivial nit.  We could just keep old 'struct vm_area_struct *vma'
> declaration.

Haha yes that's a good point! I think probably it's because I initially thought
I should drop both, then decided to keep vma around.

Anyway, I'll fix up if I need to respin but I don't think it's necessary for a
fixpatch at this point :>)

>
>
> Thanks,
> SJ
>
> [...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ