Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4693775imc; Mon, 25 Feb 2019 09:16:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IYK5MvixGlpKzYXueIVF5l3whkiOgn2ovQ7AxgJYhufTLvqRXQH6IeDi3R38hhVc4duZf1A X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr21759740plk.309.1551114980064; Mon, 25 Feb 2019 09:16:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551114980; cv=none; d=google.com; s=arc-20160816; b=oWrZm3A/GVJdrIrjsl6ShYxdKLonmtaCGR1TGz7a69nn1Di2nqOGqXtJEn3+RABu9E UrxSxDX9eEr3dPqVQbmXhIK2V6BWMqD709A3y+zpFmC/msIJawhTjkp8vjKtft1Vn7FK Wqrox+Qu8QAygs7adRCt84f+e6KX3CPtlg6/2ZJLTFOtdgua6MbVyu4aeUvnqTRJyY+2 80QYb3MJq/QkpJ6c0yeFNgcazVnQLodLdEWLCFQHbwgNI+7GFkkzFV1fBY63GT+FalS0 gYHGyX5wPG6+vDn4pXWRIARRvUOb1ZXFE/fMA9n/4JN10rOvXNHeF+9M4kVdarFoUFup rL9Q== 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=WKAOAXR3HFzPVxb60eevjJr3juEEpRbQ2o49oTqO4g4=; b=QSczsn/crfnTJqAxHICmPdC0bPpzuGaCIqzYPqtDmGEVIl14h4Nrmfu/fN9qaQmlCr fZYGaRwrPYCF/0pTp13VoiSceZ9mt4caLDVFGhSrSiodYd4HTie5tKt0+91KNc8y2dHt N2qe0Pia/uamtoPoFjZHPu2Hv18WwDmCQtnJ7OPp5/TVvv7BAVIouoJm64kShiDNee08 a5jVg7Lc/20DMPTqg9emPcz75mG1NQWHzFQ7tqTI5b6jHA7Ay0pHtmNyeV7xX6d1Pb8W L3WeN9hNrEoxNvBK8j6qRi7FJ3Uh3tHxNvgBSHiVJ14iNChiZ+2vV0j1jP/bRo70vsmB IBmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=GVB5AsbW; 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 i10si10339384pfj.186.2019.02.25.09.16.04; Mon, 25 Feb 2019 09:16:20 -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=GVB5AsbW; 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 S1728563AbfBYRPo (ORCPT + 99 others); Mon, 25 Feb 2019 12:15:44 -0500 Received: from merlin.infradead.org ([205.233.59.134]:42010 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728368AbfBYRPo (ORCPT ); Mon, 25 Feb 2019 12:15:44 -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=WKAOAXR3HFzPVxb60eevjJr3juEEpRbQ2o49oTqO4g4=; b=GVB5AsbWnCBcD5opGDDBqRAFO rkjBEIPiTz2gaufdafO9WVFaYuyLxsQKI0dhrGiBnNjUbBDOgdiGD+WtSpa2u3+/Ue26zUtLVzhgp 0+cZTSqJ1dRJqRX27hKLNio8opmJGoKJKGELBz2hUMPGSfCbP/GcSCy3pUVbrAOQNWLmu0RzI3c4B cgTd5elZ3tkKxdm5WP1UXmVTypKcPJ8BOx2ToxXKISRiV+fb9x1iUTcObkTVzyonNjRZI81iIQMs+ jMwRgAPgzUztDI6yc7FL+9i5XDlUFJfSLV2Te+fJ6VgLie2TuzZVb2pN2UV0QVYKnJT9jCpQYtK4p jaBysFUbQ==; 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 1gyJqo-0007mq-FK; Mon, 25 Feb 2019 17:15:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 323D2203E579D; Mon, 25 Feb 2019 18:15:31 +0100 (CET) Date: Mon, 25 Feb 2019 18:15:31 +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: <20190225171531.GD32534@hirez.programming.kicks-ass.net> References: <20190225124330.613028745@infradead.org> <20190225125232.191698923@infradead.org> <20190225161234.GM32477@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190225161234.GM32477@hirez.programming.kicks-ass.net> 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 05:12:34PM +0100, Peter Zijlstra wrote: > 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. Ah, so the thing we need for inline-asm is %=, but Linus didn't like it: https://lkml.kernel.org/r/20180111175626.GJ6176@hirez.programming.kicks-ass.net Also, I think at the time we didn't use it because backporting efforts. I can't really find what happened between: https://lkml.kernel.org/r/1515508997-6154-2-git-send-email-dwmw@amazon.co.uk and https://lkml.kernel.org/r/1515707194-20531-4-git-send-email-dwmw@amazon.co.uk But the %= thing went away.