Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4631735imc; Mon, 25 Feb 2019 08:13:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IZTXsseGQUg+fF/+xXMnqz0GjxBbcetapvNZBGpyze2GOFBuvONZYIKyTq1dzt/Mr8+gRqo X-Received: by 2002:a17:902:6b03:: with SMTP id o3mr21149857plk.126.1551111212969; Mon, 25 Feb 2019 08:13:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551111212; cv=none; d=google.com; s=arc-20160816; b=eA4k/ZoqbOI9T4i7reazznyXRE0pizkddcVYzA/LS7bAdG1mLN6h+6nIIi8lHIxsZw +7eSw+UP4wfP11+chwmidO/+7KMMdtO5Lmb/4DdYFAXNWO0GVOAyJacp6BmLsREne5w8 D3OqGmTFo7DmdLedGF3Ty13cIMDbyIwVi1CaJIpky1E/wh3HLmp/ObVTpXwK8eSyMoqz FnqajJ4X/hgkm+KQEun31MlrcDdGbiQkpBEKh7ARn152WS8l9NP/PHG/Kf+Lvv8zELKM IG9wyeCcGRGVlBUCzh27jyXhxxXHCCIIHu5AoPD+dMpw4l/+BDjOEYi7tj7P3QXCIHP/ kX7A== 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=kAXirJHan+nBNQ8F28vTEzq9KBqJIjUGfyURTVLP+7E=; b=n+wJUmOXwS9WLj2a98iJXMLf67s1HesLU3Qt1C/DjVK01vC5dP8YwMn3mdWZoXUh77 19zn85vitWd1oqzEOVylETN67HUItWTCEU7lSIPoOPVGuHAts97aXvfaz6p0FouUeHme 4hJ7jyDjvvUdNa8F2k9RSEP7AbNDasF+fCd90Frnjc2oBbUUp8aasVYl6NAyyDgATx8C o1L9RipgoJhiMTQ5LAq084Bbz8ft5ixOeXoK58IhV0bchDAWtqqDIWilWB/qwSRNQzq/ F9UBp/Bm/19Dcwwj4K5RWmOS+2haiDz7+MQv2TcdI4zj9c3x4Szmsg7f3NjwC6wuQ1cL F8WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=SPAw649q; 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 m6si9769355pfh.271.2019.02.25.08.13.17; Mon, 25 Feb 2019 08:13:32 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=SPAw649q; 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 S1727956AbfBYQMp (ORCPT + 99 others); Mon, 25 Feb 2019 11:12:45 -0500 Received: from merlin.infradead.org ([205.233.59.134]:41370 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727661AbfBYQMp (ORCPT ); Mon, 25 Feb 2019 11:12:45 -0500 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=kAXirJHan+nBNQ8F28vTEzq9KBqJIjUGfyURTVLP+7E=; b=SPAw649qDF6HxWYcuJHVntApR VyzUVJbVQTIROYCA266Ktja9jQiK4rlnoqI+83qnXJ4WqCEP4p4tLSOZ0wZCdXiGDC/BxGDdaKGAu 4CT3QEtEHLEW+2InPeLjRocyJoZwk+qsrCuWxzeP1BwzX7eyoZ+F0iL0VcbO+yom0phNh85kApMIo Gq0V+4PcKa9AUVDVlGg1mZQD/aCqjUUFhmXKOtodrmo4MFgdd2M7p9BOSPRRLVz9SuMRUVJXEuQ+2 s2I0IzuvTHpLm1s5g9lVLXvNTdOdu7BVVKaBZmGi3qHTYndy3vGPS7RyFcFX4TeGB6G2EBJ62KJEt V10CalSVg==; 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 1gyIrs-0007P7-Qe; Mon, 25 Feb 2019 16:12:37 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6AA48203D55EE; Mon, 25 Feb 2019 17:12:34 +0100 (CET) Date: Mon, 25 Feb 2019 17:12:34 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Linus Torvalds , Thomas Gleixner , "H. Peter Anvin" , Julien Thierry , Will Deacon , Ingo Molnar , Catalin Marinas , James Morse , valentin.schneider@arm.com, Brian Gerst , Josh Poimboeuf , Andrew Lutomirski , Borislav Petkov , Denys Vlasenko , LKML Subject: Re: [PATCH 5/6] objtool: Add UACCESS validation Message-ID: <20190225161234.GM32477@hirez.programming.kicks-ass.net> References: <20190225124330.613028745@infradead.org> <20190225125232.191698923@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Feb 25, 2019 at 07:53:01AM -0800, Andy Lutomirski wrote: > On Mon, Feb 25, 2019 at 4:53 AM Peter Zijlstra wrote: > > +#define UACCESS_SAFE(func) \ > > + asm (".pushsection .discard.uaccess_safe_strtab, \"S\", @3\n\t" \ > > + "999: .ascii \"" #func "\"\n\t" \ > > + " .byte 0\n\t" \ > > + ".popsection\n\t" \ > > + ".pushsection .discard.uaccess_safe\n\t" \ > > + ".long 999b - .\n\t" \ > > + ".popsection") > > Minor nit: using big numbers like 999: like this always bugs me. It > relies on there not being a macro nested inside or outside this that > uses the same number. My general preference is to do something like > .Ldescription_\@ instead. > > Otherwise this looks conceptually good :) I seem to remember here being an issue with the \@ thing. Notably we're not using it in nospsec-branch.h. I'll see if I can dig up why we decided not to use it there.