Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755422AbaDNVIb (ORCPT ); Mon, 14 Apr 2014 17:08:31 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:42930 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752745AbaDNVI1 (ORCPT ); Mon, 14 Apr 2014 17:08:27 -0400 Date: Mon, 14 Apr 2014 23:08:07 +0200 From: Rabin Vincent To: Kees Cook Cc: "Jon Medhurst (Tixy)" , Russell King , Catalin Marinas , Will Deacon , LKML , Laura Abbott , Alexander Holler , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 2/2] ARM: mm: make text and rodata read-only Message-ID: <20140414210807.GA25564@debian> References: <1396577719-14786-1-git-send-email-keescook@chromium.org> <1396577719-14786-3-git-send-email-keescook@chromium.org> <20140404195818.GA21028@debian> <1396960898.3567.55.camel@linaro1.home> <1396973561.14809.26.camel@linaro1.home> <20140408194815.GA6188@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 08, 2014 at 01:19:01PM -0700, Kees Cook wrote: > > To prevent any stale entries being used indefinitely, perhaps the all > > CPU TLB flush can be inserted into > > ftrace_arch_code_modify_post_process(), which is called after the > > stop_machine() and which is where x86 for example makes the entries > > read-only again. > > Do you mean something like this? Yes, something like that should probably be sufficient. > > diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c > index ea446ae09c89..b8c75e45a950 100644 > --- a/arch/arm/kernel/ftrace.c > +++ b/arch/arm/kernel/ftrace.c > @@ -90,6 +90,8 @@ int ftrace_arch_code_modify_prepare(void) > int ftrace_arch_code_modify_post_process(void) > { > set_all_modules_text_ro(); > + /* Make sure any TLB misses during machine stop are cleared. */ > + flush_tlb_all(); > return 0; > } -- 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/