[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZdaX3ckwaKO7YB2Y@debug.ba.rivosinc.com>
Date: Wed, 21 Feb 2024 16:39:57 -0800
From: Deepak Gupta <debug@...osinc.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
Cc: "ajones@...tanamicro.com" <ajones@...tanamicro.com>,
"bjorn@...osinc.com" <bjorn@...osinc.com>,
"conor.dooley@...rochip.com" <conor.dooley@...rochip.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"keescook@...omium.org" <keescook@...omium.org>,
"kito.cheng@...ive.com" <kito.cheng@...ive.com>,
"paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
"palmer@...belt.com" <palmer@...belt.com>,
"alex@...ti.fr" <alex@...ti.fr>,
"Szabolcs.Nagy@....com" <Szabolcs.Nagy@....com>,
"alexghiti@...osinc.com" <alexghiti@...osinc.com>,
"atishp@...shpatra.org" <atishp@...shpatra.org>,
"cleger@...osinc.com" <cleger@...osinc.com>,
"josh@...htriplett.org" <josh@...htriplett.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"gerg@...nel.org" <gerg@...nel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"bhe@...hat.com" <bhe@...hat.com>,
"charlie@...osinc.com" <charlie@...osinc.com>,
"david@...hat.com" <david@...hat.com>,
"samitolvanen@...gle.com" <samitolvanen@...gle.com>,
"heiko@...ech.de" <heiko@...ech.de>,
"panqinglin2020@...as.ac.cn" <panqinglin2020@...as.ac.cn>,
"mchitale@...tanamicro.com" <mchitale@...tanamicro.com>,
"corbet@....net" <corbet@....net>,
"revest@...omium.org" <revest@...omium.org>,
"mason.huo@...rfivetech.com" <mason.huo@...rfivetech.com>,
"ojeda@...nel.org" <ojeda@...nel.org>,
"baruch@...s.co.il" <baruch@...s.co.il>,
"waylingii@...il.com" <waylingii@...il.com>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"joey.gouly@....com" <joey.gouly@....com>,
"ancientmodern4@...il.com" <ancientmodern4@...il.com>,
"mathis.salmen@...sal.de" <mathis.salmen@...sal.de>,
"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"shr@...kernel.io" <shr@...kernel.io>,
"andy.chiu@...ive.com" <andy.chiu@...ive.com>,
"shuah@...nel.org" <shuah@...nel.org>,
"arnd@...db.de" <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"vincent.chen@...ive.com" <vincent.chen@...ive.com>,
"greentime.hu@...ive.com" <greentime.hu@...ive.com>,
"oleg@...hat.com" <oleg@...hat.com>,
"willy@...radead.org" <willy@...radead.org>,
"zhangqing@...ngson.cn" <zhangqing@...ngson.cn>,
"jhubbard@...dia.com" <jhubbard@...dia.com>,
"ebiederm@...ssion.com" <ebiederm@...ssion.com>,
"Wang, Xiao W" <xiao.w.wang@...el.com>,
"cuiyunhui@...edance.com" <cuiyunhui@...edance.com>,
"brauner@...nel.org" <brauner@...nel.org>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"ruscur@...sell.cc" <ruscur@...sell.cc>,
"shikemeng@...weicloud.com" <shikemeng@...weicloud.com>,
"jszhang@...nel.org" <jszhang@...nel.org>,
"jeeheng.sia@...rfivetech.com" <jeeheng.sia@...rfivetech.com>,
"alx@...nel.org" <alx@...nel.org>,
"guoren@...nel.org" <guoren@...nel.org>,
"omosnace@...hat.com" <omosnace@...hat.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"evan@...osinc.com" <evan@...osinc.com>,
"bgray@...ux.ibm.com" <bgray@...ux.ibm.com>,
"apatel@...tanamicro.com" <apatel@...tanamicro.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
Subject: Re: [RFC PATCH v1 11/28] riscv: Implementing "PROT_SHADOWSTACK" on
riscv
On Fri, Feb 09, 2024 at 08:44:35PM +0000, Edgecombe, Rick P wrote:
>On Wed, 2024-01-24 at 22:21 -0800, debug@...osinc.com wrote:
>> + /*
>> + * PROT_SHADOWSTACK is a kernel only protection flag on risc-
>> v.
>> + * mmap doesn't expect PROT_SHADOWSTACK to be set by user
>> space.
>> + * User space can rely on `map_shadow_stack` syscall to
>> create
>> + * shadow stack pages.
>> + */
>> + if (unlikely(prot & PROT_SHADOWSTACK))
>> + return -EINVAL;
>
>Are you sure you need PROT_SHADOWSTACK? Since you are passing
>VM_SHADOW_STACK into do_mmap() directly.
Sorry for (very) late response.
In this patch series since VM_SHADOW_STACK was an alias to VM_WRITE.
And that's why I needed PROT_SHADOWSTACK to disambiguate.
I am updating my patches and going with ARCH_5 bit (and thus only 64bit support).
So x86, aarch64 and risc-v will be using same bit position.
Powered by blists - more mailing lists