From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu-cheng Yu Subject: Re: [RFC PATCH v6 22/26] x86/cet/shstk: ELF header parsing of Shadow Stack Date: Thu, 25 Apr 2019 09:20:44 -0700 Message-ID: <61ca9af34259921452aaeea047016c598ef73c77.camel@intel.com> References: <20181119214809.6086-1-yu-cheng.yu@intel.com> <20181119214809.6086-23-yu-cheng.yu@intel.com> <20190425110211.GZ3567@e103592.cambridge.arm.com> <20190425153547.GG3567@e103592.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190425153547.GG3567@e103592.cambridge.arm.com> Sender: linux-kernel-owner@vger.kernel.org To: Dave Martin Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pa List-Id: linux-api@vger.kernel.org On Thu, 2019-04-25 at 16:35 +0100, Dave Martin wrote: > On Thu, Apr 25, 2019 at 08:14:52AM -0700, Yu-cheng Yu wrote: > > On Thu, 2019-04-25 at 12:02 +0100, Dave Martin wrote: > > > [...] > One other question: according to the draft spec at > https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI, it > looks like the .note.gnu.property section is supposed to be marked with > SHF_ALLOC in object files. > > I think that means that the linker will map it with a PT_LOAD entry in > the program header table in addition to the PT_NOTE that describes the > location of the note. I need to check what the toolchain actually > does. > > If so, can we simply rely on the notes being already mapped, rather than > needing to do additional I/O on the ELF file to fetch the notes? Assuming that is mapped and we do copy_from_user, it will trigger page faults. I suspect in this case reading from the file is better? Yu-cheng