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] [day] [month] [year] [list]
Message-ID: <b908cd5e-fbe0-4edf-8111-4833b6b0b188@lucifer.local>
Date: Tue, 24 Jun 2025 09:52:17 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        David Hildenbrand <david@...hat.com>, Jann Horn <jannh@...gle.com>,
        Mike Rapoport <rppt@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
        Colin Cross <ccross@...gle.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 2/2] mm, madvise: move prctl_set_vma() to mm/madvise.c

On Tue, Jun 24, 2025 at 10:12:20AM +0200, Vlastimil Babka wrote:
> On 6/23/25 19:13, Lorenzo Stoakes wrote:
> >> +{
> >> +	struct mm_struct *mm = current->mm;
> >> +	const char __user *uname;
> >> +	struct anon_vma_name *anon_name = NULL;
> >> +	int error;
> >> +
> >> +	switch (opt) {
> >> +	case PR_SET_VMA_ANON_NAME:
> >
> > So I'd like to copy just the below over to madvise - we can decide to move stuff
> > around _later_ since it's really weird to have all the anon_vma_name stuff live
> > in madvise (apart from the stuff in include/linux/mm-inline.h obv) - but I think
> > that can be a follow-up patch.
>
> Sounds good, will try to come up with a name for that function then :)

I'd say set_anon_vma_name() is best, there's no need to mention that it's
madvise as y'know that's an mm internall and weird impl deail.

Also I guess we can keep madvise_set_anon_name() the same, even though
it'll be static now as it's in line with the weird convention of prefixing
things with madvise_ even though they're in madvise.c so, y'know, kinda
implied that they're related to madvise haha

>
> > I'd like to then split out bits and pieces to make this less yucky too.
> >
> > Maybe add anon_vma_name_from_user() grabbing the characters, doing the
> > strndup_user() etc., have it call a new anon_vma_name_validate() static function
> > which does the is_valid_name_char() check against all chars, etc.
>
> Right, I'm fine leaving the followup cleanups to someone else again. My
> biggest bother was patch 1 anyway :)

Yeah of course, incremental steps are valuable here, makes the next
person's life easier :)

>
> Thanks!
>

Thanks for doing this cleanup it's a big improvement!

Cheers, Lorenzo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ