Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754733AbbK3VdH (ORCPT ); Mon, 30 Nov 2015 16:33:07 -0500 Received: from mail-ig0-f175.google.com ([209.85.213.175]:35577 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752625AbbK3VdE (ORCPT ); Mon, 30 Nov 2015 16:33:04 -0500 MIME-Version: 1.0 In-Reply-To: <565CBC37.9090106@zytor.com> References: <1448401114-24650-1-git-send-email-keescook@chromium.org> <565595F5.32536.DB9FE75@pageexec.freemail.hu> <20151126085425.GA29848@gmail.com> <20151127075959.GA24991@gmail.com> <20151129080505.GA23721@gmail.com> <565CBC37.9090106@zytor.com> Date: Mon, 30 Nov 2015 13:33:03 -0800 X-Google-Sender-Auth: b5_TIrYvxcLtCnZDdMVetA45i8c Message-ID: Subject: Re: [kernel-hardening] [PATCH 0/2] introduce post-init read-only memory From: Kees Cook To: "H. Peter Anvin" Cc: Ingo Molnar , Andy Lutomirski , Linus Torvalds , PaX Team , "kernel-hardening@lists.openwall.com" , Mathias Krause , "linux-kernel@vger.kernel.org" , Ingo Molnar , Thomas Gleixner , 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: 1762 Lines: 43 On Mon, Nov 30, 2015 at 1:14 PM, H. Peter Anvin wrote: > On 11/29/15 00:05, Ingo Molnar wrote: >> >> * Andy Lutomirski wrote: >> >>>>> - 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. >> >> Yes, this was PaX's suggestion as well, and I agree: doing that turns a quite >> possibly unrecoverable boot/shutdown time or suspend/resume time (suspend is >> really a special category of 'bootup') crasher oops into a more informative stack >> dump. >> >> These ro related faults tend to trigger when init/deinit is running, and oopsing >> in those sequences is typically a lot less survivable than say oopsing in a high >> level system call while not holding locks. >> > > I think what should do is have a debug option which can be set to "rw", > "log" or "oops"; the latter should probably be the default. Can someone write that patch, and then I will include it in the series? I haven't touched fault handler code, and it would be faster if someone more familiar with that area did it. :) -Kees -- Kees Cook Chrome OS & Brillo Security -- 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/