Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4966259imb; Thu, 7 Mar 2019 04:56:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwoeieVbO/I+5MVPqViTezMi2AG8sp4vMJRNp5FMw5ICoSHXD1kyujYhxrqB1lPMKRvSCCh X-Received: by 2002:a62:1f5d:: with SMTP id f90mr12619750pff.104.1551963397337; Thu, 07 Mar 2019 04:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551963397; cv=none; d=google.com; s=arc-20160816; b=mhrTdYBZcnGQ6p6fF/4aBO+sSEk3uJ9ICxcCvDP/Ck3DGUTr6M/ISehbrqRmrJ7M+/ xb9zLVpc6A9GyrYQpsSK8ap69ZjR/i6+cNnkBunvyjbEV/+TiahOgBSXEMe+PZxn8hP1 1LEBZHuiz/VnP2YbRicDceV4tHTUeaJ2ev+UZi76xMomP3UAbL0OqTjjFx6+6NBCyQor oQC6XNnvHGS0cV/6FX6sqtE+x2N+vmqa+uGj1n6DfJXTlHXUDj1xZZ4dabKc4Vw9qPoC 641q2qOB5bQL8Js3TOOMIbPvW4dK7eEYavd4C2tQCDnE+Z85X1plCeJ85czxOwuSsOa5 jwTg== 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=XSZkNgeDlJsSG53OA6qoCCgwdL5s/unQsXVqrhxGf3g=; b=jBf7R4qNTmCYKdDDn1hPvGVNTZcLcFeIT0wC+Ncz6OQ63JkOrdJi4dQdyoPVYwjSO9 wTEPERs2qYYPJQYrj5pSp59lIX6pvOu5Uz2aJtBLa1Mid4Utmr0oCs7dJMHZBAj/Lvp0 tVaQVaTcmV7AutnKFtGxXJI/E72vxf7lzmKXrDJ38xVYt67jPLnZZCvDNbiyQ5ap3r3N RQKIJPgYKI1Gp1xBZbCq49w0yJuaoDGRNFV+96Gs5ueKuC5kDet7fdJ352Cb/GsY2ENs D/qhQqSRe3WzE7InhZXfsJrpFvqErUn6XyYbXXxb0DEIbqyySi1Aldua90DWK/pWBAkY gSTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="s/szqWVg"; 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 k62si3823798pge.236.2019.03.07.04.56.22; Thu, 07 Mar 2019 04:56:37 -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=bombadil.20170209 header.b="s/szqWVg"; 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 S1726259AbfCGMzn (ORCPT + 99 others); Thu, 7 Mar 2019 07:55:43 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47780 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbfCGMzm (ORCPT ); Thu, 7 Mar 2019 07:55:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=XSZkNgeDlJsSG53OA6qoCCgwdL5s/unQsXVqrhxGf3g=; b=s/szqWVgPjSw+NdeXh8m66Gbm 5HQ8jq8YVSLW9+cGqiS5j8m8/d0hFM2+vg+AC7yl/OStXBqvv4QadDsF85CntjJOFjge2YIkjySPI THw28KweEi9WKjPzjTtpnSErECoaMeqxGI/BBVZEopdwa6M8r+UxlVtuYEHvUzHRcf3eg266sdQEi 3vVOOeD5S0+iV1CE/LW8cezUKzCqECCEJhiOFUKbLEKdbfOnNwLQdxv5csBKagB6RK5sBtESZWNJ1 aNMWILHK59wTyPhA6MNF39oD2hR0RPeLg364jbgUsXxd+0uY2I7Q3+w/csmR6bqb5E4L1IPeS5CCS gQuCsP2rg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1sYb-0001YQ-S8; Thu, 07 Mar 2019 12:55:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 93A4020297BBE; Thu, 7 Mar 2019 13:55:26 +0100 (CET) Date: Thu, 7 Mar 2019 13:55:26 +0100 From: Peter Zijlstra To: torvalds@linux-foundation.org, tglx@linutronix.de, hpa@zytor.com, julien.thierry@arm.com, will.deacon@arm.com, luto@amacapital.net, mingo@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, valentin.schneider@arm.com, brgerst@gmail.com, jpoimboe@redhat.com, luto@kernel.org, bp@alien8.de, dvlasenk@redhat.com Cc: linux-kernel@vger.kernel.org, dvyukov@google.com, rostedt@goodmis.org Subject: Re: [PATCH 00/20] objtool: UACCESS validation v3 Message-ID: <20190307125526.GB32534@hirez.programming.kicks-ass.net> References: <20190307114511.870090179@infradead.org> <20190307120317.GD32477@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190307120317.GD32477@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 Thu, Mar 07, 2019 at 01:03:17PM +0100, Peter Zijlstra wrote: > 01c3 20d8: 77 08 ja 20e2 <__do_sys_waitid+0x1cd> taken: randconfig-build/kernel/exit.o: warning: objtool: __do_sys_waitid()+0x1c3: (branch) > ffffffffffffe0f5 alternative("", __stringify(__ASM_STAC), X86_FEATURE_SMAP); > 01c8 20dd: 90 nop > 01c9 20de: 90 nop > 01ca 20df: 90 nop Bye-bye STAC, jumped straight over. > 01cd 20e2: 83 f0 01 xor $0x1,%eax > 01d0 20e5: 48 89 c2 mov %rax,%rdx > 01d3 20e8: 83 e2 01 and $0x1,%edx > 01d6 20eb: 48 83 c2 02 add $0x2,%rdx > 01da 20ef: 48 ff 04 d5 00 00 00 incq 0x0(,%rdx,8) > 01e1 20f6: 00 > 01de 20f3: R_X86_64_32S _ftrace_branch+0x148 > 01e2 20f7: 84 c0 test %al,%al > 01e4 20f9: 75 2d jne 2128 <__do_sys_waitid+0x213> we do not take this branch and fall-through. > ffffffffffffe0eb return -EFAULT; > ffffffffffffe0eb > ffffffffffffe0eb unsafe_put_user(signo, &infop->si_signo, Efault); > 01e6 20fb: 44 89 33 mov %r14d,(%rbx) fault, take exception: randconfig-build/kernel/exit.o: warning: objtool: __do_sys_waitid()+0x1e6: (alt) Relocation section '.rela__ex_table' at offset 0x21568 contains 18 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000000000 000200000002 R_X86_64_PC32 0000000000000000 .text + 20fb 000000000004 000200000002 R_X86_64_PC32 0000000000000000 .text + 2125 > ffffffffffffefe5 Efault: > ffffffffffffe0eb user_access_end(); > 0210 2125: 90 nop > 0211 2126: 90 nop > 0212 2127: 90 nop randconfig-build/kernel/exit.o: warning: objtool: __do_sys_waitid()+0x210: (alt) 000000000034 000200000002 R_X86_64_PC32 0000000000000000 .text + 2125 000000000038 00c800000002 R_X86_64_PC32 0000000000000000 .altinstr_replacement + c 0000000000000000 <.altinstr_replacement>: c: 0f 01 ca clac randconfig-build/kernel/exit.o: warning: objtool: .altinstr_replacement+0xc: redundant UACCESS disable