Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5997630imb; Fri, 8 Mar 2019 07:09:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxfIVEg93hQkhbdfqK9W/rawlXYA7iiZlaAOxVzoZB1N0YY5O+5lKQ9UtSO0IF+sq455gPE X-Received: by 2002:a17:902:e192:: with SMTP id cd18mr19648013plb.309.1552057750525; Fri, 08 Mar 2019 07:09:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552057750; cv=none; d=google.com; s=arc-20160816; b=de3ULPF6xtBCzJYhbjRRCYO+fNaAy6dR+Fh5WHVY/Xao/CeQ5ftnY65yGjp+ctAeN/ 4al9c7slBAm9FgTXMW+zZ9Br40HHZPqpQJ1yf/GwJxNDVK+yPNsjOAESx274jc5RI903 1rxtOcJMfix36IIvNCCkIwXelxKE41g7CQbNUCZzjqAqEY3o/0+9b0UJTpnCIBFlNK6b L8xk6vwe3v0UTewIicrXiHcGfkjLLuYVqCHnURED4IrI369ntlx0pR3vMrhGkXFdEPmx i/ZXGIyfapAtXfms+sQDPUqdoQBmjYv5noPQgw0NbgTRpbabWIYnl6zL8modepw+sZNV yL0Q== 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; bh=r2VFBqprkEyk9DXNxUdp2k6nQADOwjgy1vkqC4JVV4A=; b=wVdeqVHyE6Z9Q0YdPG+9q0stA1yYyNRufYLbCoGEkY+caVJl88kqgBldtHFX/tNtwp EAIz1H62eo13Oq3BYqQRYESyhc4QHVDRBIYsRAdfXIEanmMWVLf20nI2vF3jO09W53g4 gMbUcJ3OkDWmPPL+mnGAVTx4oaN6+17OaDB/dA94gs1o0x7ilUbfa/mOObB98I/78lSM LXcZ19DtOCnMkxdes7FAD+abDF5cCpSEJRp8mXqdLWRFFhy2MqjCz8jNekt3M7MZBc2E 5JBc4YK3XPtB9OtZyQitCMNjspVplG5QaZrexC5mCI2FRlpihW5VWD9N4FmgKgSY0VeW cJTw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l189si6606380pgd.246.2019.03.08.07.08.55; Fri, 08 Mar 2019 07:09:10 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbfCHPHO (ORCPT + 99 others); Fri, 8 Mar 2019 10:07:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57572 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbfCHPHN (ORCPT ); Fri, 8 Mar 2019 10:07:13 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BBF0307D985; Fri, 8 Mar 2019 15:07:13 +0000 (UTC) Received: from treble (ovpn-120-61.rdu2.redhat.com [10.10.120.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81D2360BE7; Fri, 8 Mar 2019 15:07:10 +0000 (UTC) Date: Fri, 8 Mar 2019 09:07:03 -0600 From: Josh Poimboeuf To: Peter Zijlstra Cc: Linus Torvalds , Thomas Gleixner , Peter Anvin , Julien Thierry , Will Deacon , Andy Lutomirski , Ingo Molnar , Catalin Marinas , James Morse , valentin.schneider@arm.com, Brian Gerst , Andrew Lutomirski , Borislav Petkov , Denys Vlasenko , Linux List Kernel Mailing , Dmitry Vyukov , Steven Rostedt Subject: Re: [PATCH 18/20] objtool: Add UACCESS validation Message-ID: <20190308150703.3jozuvj2crcxvlzp@treble> References: <20190307114511.870090179@infradead.org> <20190307115200.697533978@infradead.org> <20190307174135.GJ32477@hirez.programming.kicks-ass.net> <20190307184813.GL32477@hirez.programming.kicks-ass.net> <20190307202319.GD32534@hirez.programming.kicks-ass.net> <20190307204021.GE32534@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190307204021.GE32534@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 08 Mar 2019 15:07:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 07, 2019 at 09:40:21PM +0100, Peter Zijlstra wrote: > On Thu, Mar 07, 2019 at 09:23:19PM +0100, Peter Zijlstra wrote: > > On Thu, Mar 07, 2019 at 07:48:13PM +0100, Peter Zijlstra wrote: > > > Another thing I need to look at is why objtool only found memset_orig > > > (from __memset) but not memset_erms, which if I read the code right, is > > > a possible alternative there. > > > > Turns out we only look for sibling calls in the original instruction > > stream, not in any alternatives; which in general seems like a fair > > enough assumption. > > And while I'm looking at memset_64.S, why are memset_erms and > memset_orig global functions? At the very least they should be local, > and ideally not even functions. I think the only benefit is that they would show up better on stack traces, but that could also be solved by just making them local labels inside memset. Which is what I think they should be. The general rule is that ENDPROC is only used for callable functions, so yeah, I think the current setup isn't ideal, and also prevents objtool from properly doing the AC analysis as you pointed out earlier. -- Josh