From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83C44C04AAA for ; Fri, 3 May 2019 18:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 570782081C for ; Fri, 3 May 2019 18:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbfECSqi (ORCPT ); Fri, 3 May 2019 14:46:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:55782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbfECSqi (ORCPT ); Fri, 3 May 2019 14:46:38 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 C71412075E; Fri, 3 May 2019 18:46:34 +0000 (UTC) Date: Fri, 3 May 2019 14:46:33 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Linus Torvalds , 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 Subject: Re: [RFC][PATCH 1.5/2] x86: Add int3_emulate_call() selftest Message-ID: <20190503144633.750ca9a5@gandalf.local.home> In-Reply-To: <20190503102247.GC2623@hirez.programming.kicks-ass.net> References: <20190501202830.347656894@goodmis.org> <20190503102247.GC2623@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 May 2019 12:22:47 +0200 Peter Zijlstra wrote: > Given that the entry_*.S changes for this functionality are somewhat > tricky, make sure the paths are tested every boot, instead of on the > rare occasion when we trip an INT3 while rewriting text. > > Getting the INT3 frame setup even slightly wrong will make this come > unstuck something spectacular. > > Requested-by: Andy Lutomirski > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/x86/kernel/alternative.c | 81 ++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 77 insertions(+), 4 deletions(-) I'll add this to my queue, as I tested this on x86_32 and 64. I also put in a printk("HERE in int3_magic\n") to make sure it really did get there (although, the BUG_ON should be good enough). The printk will be removed from the official commit. It was just for my peace of mind. -- Steve From mboxrd@z Thu Jan 1 00:00:00 1970 From: rostedt at goodmis.org (Steven Rostedt) Date: Fri, 3 May 2019 14:46:33 -0400 Subject: [RFC][PATCH 1.5/2] x86: Add int3_emulate_call() selftest In-Reply-To: <20190503102247.GC2623@hirez.programming.kicks-ass.net> References: <20190501202830.347656894@goodmis.org> <20190503102247.GC2623@hirez.programming.kicks-ass.net> Message-ID: <20190503144633.750ca9a5@gandalf.local.home> On Fri, 3 May 2019 12:22:47 +0200 Peter Zijlstra wrote: > Given that the entry_*.S changes for this functionality are somewhat > tricky, make sure the paths are tested every boot, instead of on the > rare occasion when we trip an INT3 while rewriting text. > > Getting the INT3 frame setup even slightly wrong will make this come > unstuck something spectacular. > > Requested-by: Andy Lutomirski > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/x86/kernel/alternative.c | 81 ++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 77 insertions(+), 4 deletions(-) I'll add this to my queue, as I tested this on x86_32 and 64. I also put in a printk("HERE in int3_magic\n") to make sure it really did get there (although, the BUG_ON should be good enough). The printk will be removed from the official commit. It was just for my peace of mind. -- Steve From mboxrd@z Thu Jan 1 00:00:00 1970 From: rostedt@goodmis.org (Steven Rostedt) Date: Fri, 3 May 2019 14:46:33 -0400 Subject: [RFC][PATCH 1.5/2] x86: Add int3_emulate_call() selftest In-Reply-To: <20190503102247.GC2623@hirez.programming.kicks-ass.net> References: <20190501202830.347656894@goodmis.org> <20190503102247.GC2623@hirez.programming.kicks-ass.net> Message-ID: <20190503144633.750ca9a5@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" Message-ID: <20190503184633.WRRmOHJka2Rjex5Asth8nJFEnDkfKRarnmB6CRqsvEg@z> On Fri, 3 May 2019 12:22:47 +0200 Peter Zijlstra wrote: > Given that the entry_*.S changes for this functionality are somewhat > tricky, make sure the paths are tested every boot, instead of on the > rare occasion when we trip an INT3 while rewriting text. > > Getting the INT3 frame setup even slightly wrong will make this come > unstuck something spectacular. > > Requested-by: Andy Lutomirski > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/x86/kernel/alternative.c | 81 ++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 77 insertions(+), 4 deletions(-) I'll add this to my queue, as I tested this on x86_32 and 64. I also put in a printk("HERE in int3_magic\n") to make sure it really did get there (although, the BUG_ON should be good enough). The printk will be removed from the official commit. It was just for my peace of mind. -- Steve