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]
Date: Mon, 18 Mar 2024 01:00:12 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "debug@...osinc.com" <debug@...osinc.com>, "luto@...nel.org"
	<luto@...nel.org>, "x86@...nel.org" <x86@...nel.org>,
	"Liam.Howlett@...cle.com" <Liam.Howlett@...cle.com>, "broonie@...nel.org"
	<broonie@...nel.org>, "keescook@...omium.org" <keescook@...omium.org>,
	"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>, "hpa@...or.com"
	<hpa@...or.com>, "christophe.leroy@...roup.eu" <christophe.leroy@...roup.eu>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>, "mingo@...hat.com"
	<mingo@...hat.com>, "kirill.shutemov@...ux.intel.com"
	<kirill.shutemov@...ux.intel.com>, "bp@...en8.de" <bp@...en8.de>,
	"tglx@...utronix.de" <tglx@...utronix.de>, "peterz@...radead.org"
	<peterz@...radead.org>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 10/12] x86/mm: Implement
 HAVE_ARCH_UNMAPPED_AREA_VMFLAGS

On Wed, 2024-03-13 at 09:00 -0700, Rick Edgecombe wrote:
> > Wouldn't it be better to define those two as static inlines ?
> 
> Yes, I think so.

I gave this a try and it turned out not to fit into any header too
well. I decided putting it into a generic header was not great since
these are actually supposed to be arch implementations. Emphasizing
that point, mmap.c actually defines these unless
HAVE_ARCH_UNMAPPED_AREA is defined. So to make it work, mm.h would have
to assume that if HAVE_ARCH_UNMAPPED_AREA and
HAVE_ARCH_UNMAPPED_AREA_TOPDOWN are defined, the arch actually doesn't
have an arch_unmmapped_area() and wants a static inline version of
arch_get_unmapped_area(). It confuses the meaning of
HAVE_ARCH_UNMAPPED_AREA a bit to mean the opposite in some cases.
Adding a ARCH_WANTS_UNMAPPED_AREA_INLINE seemed excessive.

As for putting them in an arch/x86 header, I tried asm/mmu.h, but
arch_get_unmapped_area_topdown/_vmflags() had to be forward declared.
But then also vm_flags_t couldn't be pulled in properly because of a
circular dependency. A few others hit weirdness or breakages.

So in the end, I decided to just leave it as a non-static inline in
arch/x86. Unless there are any objections, I'm going to just let 0-day
build test all the archs, and I'll post the series with the rest of the
feedback in a few days.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ