From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH 00/29] vmlinux.lds.h: Refactor EXCEPTION_TABLE and NOTES Date: Thu, 10 Oct 2019 20:03:31 +0200 Message-ID: <20191010180331.GI7658@zn.tnic> References: <20190926175602.33098-1-keescook@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org To: Kees Cook Cc: Thomas Gleixner , Rick Edgecombe , Ingo Molnar , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , Michal Simek , linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org, linux-kernel@vger.kernel.org List-Id: linux-arch.vger.kernel.org On Thu, Sep 26, 2019 at 10:55:33AM -0700, Kees Cook wrote: > This series works to move the linker sections for NOTES and > EXCEPTION_TABLE into the RO_DATA area, where they belong on most > (all?) architectures. The problem being addressed was the discovery > by Rick Edgecombe that the exception table was accidentally marked > executable while he was developing his execute-only-memory series. When > permissions were flipped from readable-and-executable to only-executable, > the exception table became unreadable, causing things to explode rather > badly. :) > > Roughly speaking, the steps are: > > - regularize the linker names for PT_NOTE and PT_LOAD program headers > (to "note" and "text" respectively) > - regularize restoration of linker section to program header assignment > (when PT_NOTE exists) > - move NOTES into RO_DATA > - finish macro naming conversions for RO_DATA and RW_DATA > - move EXCEPTION_TABLE into RO_DATA on architectures where this is clear > - clean up some x86-specific reporting of kernel memory resources > - switch x86 linker fill byte from x90 (NOP) to 0xcc (INT3), just because > I finally realized what that trailing ": 0x9090" meant -- and we should > trap, not slide, if execution lands in section padding Yap, nice patchset overall. > Since these changes are treewide, I'd love to get architecture-maintainer > Acks and either have this live in x86 -tip or in my own tree, however > people think it should go. Sure, I don't mind taking v2 through tip once I get ACKs from the respective arch maintainers. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.skyhub.de ([5.9.137.197]:55890 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfJJSDf (ORCPT ); Thu, 10 Oct 2019 14:03:35 -0400 Date: Thu, 10 Oct 2019 20:03:31 +0200 From: Borislav Petkov Subject: Re: [PATCH 00/29] vmlinux.lds.h: Refactor EXCEPTION_TABLE and NOTES Message-ID: <20191010180331.GI7658@zn.tnic> References: <20190926175602.33098-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190926175602.33098-1-keescook@chromium.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kees Cook Cc: Thomas Gleixner , Rick Edgecombe , Ingo Molnar , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , Michal Simek , linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org, linux-kernel@vger.kernel.org Message-ID: <20191010180331.CG2ZdBsNwQyPO_9uEQPW8hER48IHpxMbhJy3PCVN-EQ@z> On Thu, Sep 26, 2019 at 10:55:33AM -0700, Kees Cook wrote: > This series works to move the linker sections for NOTES and > EXCEPTION_TABLE into the RO_DATA area, where they belong on most > (all?) architectures. The problem being addressed was the discovery > by Rick Edgecombe that the exception table was accidentally marked > executable while he was developing his execute-only-memory series. When > permissions were flipped from readable-and-executable to only-executable, > the exception table became unreadable, causing things to explode rather > badly. :) > > Roughly speaking, the steps are: > > - regularize the linker names for PT_NOTE and PT_LOAD program headers > (to "note" and "text" respectively) > - regularize restoration of linker section to program header assignment > (when PT_NOTE exists) > - move NOTES into RO_DATA > - finish macro naming conversions for RO_DATA and RW_DATA > - move EXCEPTION_TABLE into RO_DATA on architectures where this is clear > - clean up some x86-specific reporting of kernel memory resources > - switch x86 linker fill byte from x90 (NOP) to 0xcc (INT3), just because > I finally realized what that trailing ": 0x9090" meant -- and we should > trap, not slide, if execution lands in section padding Yap, nice patchset overall. > Since these changes are treewide, I'd love to get architecture-maintainer > Acks and either have this live in x86 -tip or in my own tree, however > people think it should go. Sure, I don't mind taking v2 through tip once I get ACKs from the respective arch maintainers. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette