Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755038AbbK0UJq (ORCPT ); Fri, 27 Nov 2015 15:09:46 -0500 Received: from mail-oi0-f54.google.com ([209.85.218.54]:35549 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754080AbbK0UJn (ORCPT ); Fri, 27 Nov 2015 15:09:43 -0500 MIME-Version: 1.0 In-Reply-To: References: <1448401114-24650-1-git-send-email-keescook@chromium.org> <565595F5.32536.DB9FE75@pageexec.freemail.hu> <20151126085425.GA29848@gmail.com> <20151127075959.GA24991@gmail.com> From: Andy Lutomirski Date: Fri, 27 Nov 2015 12:09:23 -0800 Message-ID: Subject: Re: [kernel-hardening] [PATCH 0/2] introduce post-init read-only memory To: Kees Cook Cc: Linus Torvalds , Ingo Molnar , PaX Team , "kernel-hardening@lists.openwall.com" , Mathias Krause , "linux-kernel@vger.kernel.org" , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , x86-ml , Arnd Bergmann , Michael Ellerman , linux-arch , Emese Revfy Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1686 Lines: 41 On Fri, Nov 27, 2015 at 12:03 PM, Kees Cook wrote: > On Fri, Nov 27, 2015 at 10:00 AM, Linus Torvalds > wrote: >> On Thu, Nov 26, 2015 at 11:59 PM, Ingo Molnar wrote: >>> >>> * Andy Lutomirski wrote: >>> >>>> > Can you see any fragility in such a technique? >>>> >>>> After Linus shot down my rdmsr/rwmsr decoding patch, good luck... >>> >>> I think that case was entirely different, but I've Cc:-ed Linus to shoot my idea >>> down if it's crap. >> >> Yeah, no, I hate it. I'm with the PaX team on this one - I think there >> are three valid responses, and I think we might want to have a dynamic >> config option (kernel command line or proc or whatever) to pick >> between the two: >> >> - just oops and kill the machine, like for any other unhandled kernel >> page fault. This is probably what you should have on a server > > This is how the v2 series works now. > >> - print a warning and a backtrace, and just mark the page read-write >> so that the machine survives, but we get notified and can fix whatever >> broken code > > This seems very easy to add. Should I basically reverse the effects of > mark_rodata_ro(), or should I only make the new ro-after-init section > as RW? (I think the former would be easier.) I'd suggest verifying that the page in question is .data..ro_after_init and, if so, marking that one page RW. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/