Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3694970yba; Tue, 7 May 2019 05:43:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6e3fegWay4ZK1uUTuPRdsz/jZHzhZjCdRbl6nx7SeJZ8FCoIaY/P9DDMJwsf94Drd/qfV X-Received: by 2002:aa7:8683:: with SMTP id d3mr2277671pfo.145.1557233006093; Tue, 07 May 2019 05:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557233006; cv=none; d=google.com; s=arc-20160816; b=I0E1FJXabXFR8ygD8ciF1rvmKXLklDotuDr1KXRZXF0p6eBRDlW377NyhNwcyNSULH LyV6XRLV+W1f4ZkMI34HMcSbYvYSDeRZbgcKF1+a2AOMro9M/Uqc34nP+HyQpUaVbQsU 4g4QbMkQiT/JUwKO7diiCOx+qfC4uSaF1lpfZBNQ1wUOknEoKbcV9QmXCNEM9NBB9d8L Y+YF5SIUaBoRmFhXKje9zycLCAI7R8n9Y5q1WavcBwBRRpaBvfCpFIZJ8eJ0TfsvirXN vchPuOquN5Q22rSE7pSBSnCwpCJ49xTFSEECu2ZwM+cZy7anbv3NXMyajy6VuZqXKp1v I2bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=81opB8G7Ipd0tVreem0atOppp7UchqtWU6V9nRjg3jM=; b=o78U2IsbjdLzxEvxLHfFbsVfpMpj/w6MDWOsokLkePJK7leaLW9EjujC/wDWVveuNy xDTNN6TOPrj6hy61thYJqyZXiWtVfFdrBB1U63JCfEJjEC9QEBrCeMOCVvgIyP4Fh0F7 BcuRRBoS2S46hnL5SyCe0d46TQy84Y5f2qBYPRQmVWVDImN2BpxDhlXxSIMjHIgIwG5n hBwAbRzNIDYgk9HDJ/iMvmcOec9Ocwpo7EY6zt01jMfQvknYIigfkJDUUiqT5I73f/9r w0jOGCTpLZrN5CffdU1t6M2/Ux/iRzvVPlwQ1aTyGQRVi5X1gzlmq9yZ2hnbqST4ODXh ZvkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=gYkz85Ty; 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 t14si1232201pgm.166.2019.05.07.05.43.10; Tue, 07 May 2019 05:43:26 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=gYkz85Ty; 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 S1726569AbfEGMmO (ORCPT + 99 others); Tue, 7 May 2019 08:42:14 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38860 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbfEGMmN (ORCPT ); Tue, 7 May 2019 08:42:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=81opB8G7Ipd0tVreem0atOppp7UchqtWU6V9nRjg3jM=; b=gYkz85TyaiCt6SSCYspfu7uf9 jrbc5Y4/InQcMFAT0lSX2OtfOHyC7APTtxe7YAvNjuUX2ihF5HCVIc6jH2JgTZGSaGI1e0PKeEZmt XnPXmbtxl5YVqwGOFgPjLYhvKx1yPuZqmO+6TPlK+x51gIogJjQGwTE5q2MedgGWpcfx/aGUiq1S8 Z8ikXYv0UkkBzGkghK3nRMHvHYV+LJWXiG+YyIv06fEAuoLkx95svxUFDcbWJI2H3IMiWwEvZ3Hx+ NPcwK8hTflUo0JgfVKgMRLR8T03VTctYK6VVILJqOOqyUf7CTrnrDBnr/UGJKx7pREwTGjydZREIz 8T9xtBqXQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNzPa-0007Bf-CG; Tue, 07 May 2019 12:41:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D30DC201E11CE; Tue, 7 May 2019 14:41:31 +0200 (CEST) Date: Tue, 7 May 2019 14:41:31 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: Linus Torvalds , Andy Lutomirski , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , "open list:KERNEL SELFTEST FRAMEWORK" , stable , Masami Hiramatsu Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions Message-ID: <20190507124131.GO2623@hirez.programming.kicks-ass.net> References: <20190502193129.664c5b2e@gandalf.local.home> <20190502195052.0af473cf@gandalf.local.home> <20190503092959.GB2623@hirez.programming.kicks-ass.net> <20190503092247.20cc1ff0@gandalf.local.home> <2045370D-38D8-406C-9E94-C1D483E232C9@amacapital.net> <20190506081951.GJ2606@hirez.programming.kicks-ass.net> <20190507085753.GO2606@hirez.programming.kicks-ass.net> <20190507092731.GH2650@hirez.programming.kicks-ass.net> <20190507082716.73cd5a01@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190507082716.73cd5a01@gandalf.local.home> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 07, 2019 at 08:27:16AM -0400, Steven Rostedt wrote: > On Tue, 7 May 2019 11:27:31 +0200 > Peter Zijlstra wrote: > > > FWIW, both these trampolines assume a kprobe will not > > int3_emulate_{push/call}(), for both bitnesses. > > > > But then; I'm thinking kprobes should be inspection only and not modify > > things. So that might just be good enough. > > I believe there are kprobe calls that do modify things. Note, they can > modify regs->ip. The kprobe pre_handler as used by kretprobes does, and that is indeed handled by the trampolines. > Kprobes sets the FTRACE_OPS_FL_IPMODIFY flag, thus > they can never be put at the same location that is being live patched. OK, so do we want to allow kprobes that also modify regs->sp ? Because then we need to change these trampolines a bit. I'd prefer not to allow kprobes this.