From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbbH1TzD (ORCPT ); Fri, 28 Aug 2015 15:55:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56402 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552AbbH1TzA (ORCPT ); Fri, 28 Aug 2015 15:55:00 -0400 Date: Fri, 28 Aug 2015 14:54:57 -0500 From: Josh Poimboeuf To: Andi Kleen Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Pedro Alves , Namhyung Kim , Bernd Petrovitsch , Chris J Arges , Andrew Morton Subject: Re: [PATCH v11 03/20] x86/stackvalidate: Compile-time stack validation Message-ID: <20150828195457.GB27761@treble.redhat.com> References: <20150826142628.GN1747@two.firstfloor.org> <20150827142953.GC26200@treble.redhat.com> <20150828172622.GO1747@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150828172622.GO1747@two.firstfloor.org> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2015 at 07:26:23PM +0200, Andi Kleen wrote: > > > BTW how do handle the increasing number of JITs in the kernel? > > > > Yeah, compile-time CFI wouldn't be applicable for code which is > > generated at runtime. Maybe we will need a mechanism to allow eBPF to > > quickly create minimal CFI-like metadata corresponding to the JIT code > > it generates, which can be used by stack dumping code to identify the > > JIT code and find the previous stack pointer on the stack. > > Perhaps I'm missing something, but for the hot patching you need > some solution for this, as you rely on 100% accuracy. Right? We'll probably need something like that eventually, once we have an in-kernel CFI unwinder. Until then, for live patching we would just need to make sure the JIT generated code honors CONFIG_FRAME_POINTER. > I guess for now it could be some kind of big reader/writer lock > for JIT code and reject hot patching if something is active there. Yeah, maybe. Another easy way to handle it would be to bail if we can't find the CFI for a given address on a task's stack. -- Josh