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: <bcd71ac6539e48359e8a80cb74115964@AcuMS.aculab.com>
Date:   Thu, 10 Mar 2022 22:37:30 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Andrew Cooper' <Andrew.Cooper3@...rix.com>,
        Bharata B Rao <bharata@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "catalin.marinas@....com" <catalin.marinas@....com>,
        "will@...nel.org" <will@...nel.org>,
        "shuah@...nel.org" <shuah@...nel.org>,
        "oleg@...hat.com" <oleg@...hat.com>,
        "ananth.narayan@....com" <ananth.narayan@....com>
Subject: RE: [RFC PATCH v0 3/6] x86: Enable Upper Address Ignore(UAI) feature

From: Andrew Cooper
> Sent: 10 March 2022 19:47
> 
> On 10/03/2022 11:15, Bharata B Rao wrote:
> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> > index f7a132eb794d..12615b1b4af5 100644
> > --- a/arch/x86/kernel/setup.c
> > +++ b/arch/x86/kernel/setup.c
> > @@ -740,6 +740,12 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p)
> >  	return 0;
> >  }
> >
> > +static inline void __init uai_enable(void)
> > +{
> > +	if (boot_cpu_has(X86_FEATURE_UAI))
> > +		msr_set_bit(MSR_EFER, _EFER_UAI);
> > +}
> > +
> >  /*
> >   * Determine if we were loaded by an EFI loader.  If so, then we have also been
> >   * passed the efi memmap, systab, etc., so we should use these data structures
> > @@ -1146,6 +1152,8 @@ void __init setup_arch(char **cmdline_p)
> >
> >  	x86_init.paging.pagetable_init();
> >
> > +	uai_enable();
> 
> I would think incredibly carefully before enabling UAI by default.
> 
> Suffice it to say that Intel were talked down from 7 bits to 6, and
> apparently AMD didn't get the same memo from the original requesters.
> 
> The problem is that UAI + LA57 means that all the poison pointers cease
> functioning as a defence-in-depth mechanism, and become legal pointers
> pointing at random positions in user or kernel space.

Isn't that true regardless of how many bits are 'ignored'.
AFAICT the only sane thing would be to have something in the cpu
that verifies the 'ignored' bits match values set in the PTE.
That could be used to ensure (well make it more likely) that stack
access stay in the stack and pointers to mmap()ed data stay
pointing to the correct pages.

Just letting user address space be aliased a lot of times doesn't
seem like a security feature to me.
It must have some strange use case.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ