Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2765017imu; Thu, 29 Nov 2018 09:51:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/XN8mFsSpNesIC3qD6Klp3/gkyiguaOg9XeUqjXrkC8JhsVTVd3X/UdavJKq0mYADQZK9Nf X-Received: by 2002:a63:5455:: with SMTP id e21mr2068372pgm.316.1543513906014; Thu, 29 Nov 2018 09:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543513905; cv=none; d=google.com; s=arc-20160816; b=VR9r5YCSKpAYFLX6N8rsm6lE/YfDQh/lsfXDwUObu06rsmqYtgp3EyvP8XG62/1Y+l Yol6Xrcy4QbGSL1gnubh+lWhsruhBGlh7ErwB/7KlEHWdAsEV4wKcKXagYaC+gKgxuUV y7u9dNY2IgWvlJ2RXXz3MLXkBR9omFfyDwNNYodALS7wNKY82KAEbft3UNw3robv9EbK tnnXKXEs5uJKytpRPa6q0oPtHAUvk48axRfk9e4rFANblUIk+JCQDZy8WdMWy5Yi2Qxc w58Wsf9fGYX0CCduFLhiFNSUCT6gniVswXaVxsSUWJEjqOkwTq6GktabO1n0S956L4Rz QMcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=O/z9hW3gRemfxb1sSjHy87xtDf7jU3IADxeAohfv0F0=; b=VMJoF1bmvFaC4/TicRk8Tqn/eYr4OFLZv8UjUpwN6+miLILidWYEfK/2UypPLqz2R3 1zUJzwv3ZIDy6PzooTmqqES5f/ZEronhZE41u0riZ8gGn7hBy0rQzGlO6Z5tLuGuzvpO iMro1QUS97ZruAUFyUzUeGq3mIqlz7e3BnviXQc+W/bCEBmsKqNatb8F5EMRO1UISSg2 o3EdvJ/F6ulerEIfPiCBCinb1N1VxIkxL9eJsiPhmNn80sCJgVTEZrXv4u8el5W2qiui x3VzTDMgt38y4uYJ2QsHJb2NJPW5mGyaf6CVypxAHlWFxntlMyN0kce+ghSw51NyyfkY ZDQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y18si2684193plp.269.2018.11.29.09.51.31; Thu, 29 Nov 2018 09:51:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731193AbeK3E4H convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Nov 2018 23:56:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:55390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730817AbeK3E4G (ORCPT ); Thu, 29 Nov 2018 23:56:06 -0500 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 857D1213A2; Thu, 29 Nov 2018 17:49:54 +0000 (UTC) Date: Thu, 29 Nov 2018 12:49:52 -0500 From: Steven Rostedt To: Andy Lutomirski Cc: Peter Zijlstra , Josh Poimboeuf , Andy Lutomirski , X86 ML , LKML , Ard Biesheuvel , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , julia@ni.com, jeyu@kernel.org, "H. Peter Anvin" Subject: Re: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64 Message-ID: <20181129124952.70b0385c@gandalf.local.home> In-Reply-To: <666E3CE2-CD96-4271-8F9C-614F96D24F26@amacapital.net> References: <20181126200801.GW2113@hirez.programming.kicks-ass.net> <20181126212628.4apztfazichxnt7r@treble> <20181127084330.GX2113@hirez.programming.kicks-ass.net> <20181129094210.GC2131@hirez.programming.kicks-ass.net> <20181129143853.GO2131@hirez.programming.kicks-ass.net> <20181129163342.tp5wlfcyiazwwyoh@treble> <20181129164914.GA9027@hirez.programming.kicks-ass.net> <0FDA053D-7ADC-4F42-AEA5-99DA155FCED0@amacapital.net> <20181129171539.GD9027@hirez.programming.kicks-ass.net> <20181129122000.7fb4fb04@gandalf.local.home> <20181129122156.782e739e@gandalf.local.home> <666E3CE2-CD96-4271-8F9C-614F96D24F26@amacapital.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Nov 2018 09:41:33 -0800 Andy Lutomirski wrote: > > On Nov 29, 2018, at 9:21 AM, Steven Rostedt wrote: > > > > On Thu, 29 Nov 2018 12:20:00 -0500 > > Steven Rostedt wrote: > > > > > >> r8 = return address > >> r9 = function to call > >> > > > > Bad example, r8 and r9 are args, but r10 and r11 are available. > > > > -- Steve > > > >> push r8 > >> jmp *r9 > >> > >> Then have the regs->ip point to that trampoline. > > Cute. That’ll need ORC annotations and some kind of retpoline to replace the indirect jump, though. > Do we really need to worry about retpoline here? I'm not fully up on all the current vulnerabilities, but can this really be taken advantage of when it only happens in the transition of changing a static call with the small chance of one of those calls triggering the break point? If someone can take advantage of that, I almost think they deserve cracking my box ;-) -- Steve