[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a4c97f68347d4188286c543cdccaa12577cdb9e.camel@intel.com>
Date: Tue, 18 Jul 2023 15:49:28 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "broonie@...nel.org" <broonie@...nel.org>,
"Szabolcs.Nagy@....com" <Szabolcs.Nagy@....com>
CC: "corbet@....net" <corbet@....net>,
"ardb@...nel.org" <ardb@...nel.org>,
"maz@...nel.org" <maz@...nel.org>,
"shuah@...nel.org" <shuah@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"keescook@...omium.org" <keescook@...omium.org>,
"james.morse@....com" <james.morse@....com>,
"debug@...osinc.com" <debug@...osinc.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"palmer@...belt.com" <palmer@...belt.com>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"hjl.tools@...il.com" <hjl.tools@...il.com>,
"paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"oleg@...hat.com" <oleg@...hat.com>,
"arnd@...db.de" <arnd@...db.de>,
"ebiederm@...ssion.com" <ebiederm@...ssion.com>,
"will@...nel.org" <will@...nel.org>,
"suzuki.poulose@....com" <suzuki.poulose@....com>,
"kvmarm@...ts.linux.dev" <kvmarm@...ts.linux.dev>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>
Subject: Re: [PATCH 22/35] arm64/mm: Implement map_shadow_stack()
On Tue, 2023-07-18 at 14:55 +0100, Mark Brown wrote:
> On Tue, Jul 18, 2023 at 10:10:04AM +0100, Szabolcs Nagy wrote:
>
> > uint64_t *p = map_shadow_stack(0, N*8, 0);
>
> > i'd expect p[N-1] to be the end token and p[N-2] to be the cap
> > token,
> > not p[PAGE_ALIGN(N*8)/8-2].
>
> Yes, that probably would be more helpful.
HJ made a similar request on the x86 side. He wanted an unaligned size
passed in to result in unaligned token placement.
>
> > if we allow misalligned size here (and in munmap) then i think it's
> > better to not page align. size%8!=0 || size<16 can be an error.
>
> Honestly I'd be a lot happier to just not allow misalignment but that
> raises the issue with binaries randomly not working when moved to a
> kernel with a different page size. I'll have a think but possibly
> the
> safest thing would be requiring a multiple of 4K then rounding up to
> our
> actual page size.
Someday when the x86 side is finally upstream I have a manpage for
map_shadow_stack. Any differences on the arm side would need to be
documented, but I'm not sure why there should be any differences. Like,
why not use the same flags? Or have a new flag for token+end marker
that x86 can use as well?
Powered by blists - more mailing lists