Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753675AbbFLLSY (ORCPT ); Fri, 12 Jun 2015 07:18:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46871 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbbFLLSV (ORCPT ); Fri, 12 Jun 2015 07:18:21 -0400 Message-ID: <557ABFF8.5040304@redhat.com> Date: Fri, 12 Jun 2015 12:18:16 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Josh Poimboeuf , Ingo Molnar CC: Andy Lutomirski , Michal Marek , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "linux-kernel@vger.kernel.org" , Andi Kleen , live-patching@vger.kernel.org, X86 ML , "H. Peter Anvin" , Linus Torvalds , Peter Zijlstra Subject: Re: [PATCH v5 02/10] x86: Compile-time asm code validation References: <20150610175320.GD29724@treble.redhat.com> <20150610185845.GA1125@treble.redhat.com> <20150611061050.GB30720@gmail.com> <20150611141000.GC11517@treble.redhat.com> In-Reply-To: <20150611141000.GC11517@treble.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1076 Lines: 24 On 06/11/2015 03:10 PM, Josh Poimboeuf wrote: > C would definitely make more sense when analyzing object code. In fact, > asmvalidate is written in C. But then I guess we'd have to re-implement > the .cfi stuff and populate the DWARF sections manually instead of > letting the assembler do it. Was doing all this directly in the assembler considered? That is, e.g., add some knob that makes it error/warn in the same conditions you're making the validator catch. For tail calls, you'd e.g., add some new ".nonlocal" directive that you'd use to whitelist the following jump. And then if it's possible run a CFI generator as a separate step over the source, it sounds like it should also be possible to have the assembler do it instead too (again with some new high level directive to trigger/help it). Thanks, Pedro Alves -- 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/