Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1655865rwe; Fri, 2 Sep 2022 01:10:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4rje1QV6DtMcNBilnvjmy8jzhuTzyPfOzDiO2+tGYuV0t9gIiVGPITSZV6Fe18p9RbuZIO X-Received: by 2002:a17:90a:4801:b0:1fa:98ec:fa2 with SMTP id a1-20020a17090a480100b001fa98ec0fa2mr3458703pjh.41.1662106250372; Fri, 02 Sep 2022 01:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662106250; cv=none; d=google.com; s=arc-20160816; b=Tek91REytnv5EMcIm6Ret5g4pzGayXpcTcWox92pbUBDarhYuPt+P4zUG+LO4cXreW CJurrEsqDX1Np72an7dslK1Os9J7cZQd16ZFWQYADeowWUsuO6R9GBUuWxqKK5SfjawZ AB7Nou/MCuzvH4XAhDOrPbGlPQCymearqcx6UcpCJYuJeH7BpO/D5g9DYY6DTT8uR8JF JRGbMNsQVHDAXdK8DkWFb4CsioPNTJemts0C6HnQg3Yd/MmQsaU/zbC6vZUE6eUMyZzY t0Fk6YTT4AHR3P9t8h6E57k7XSqLM9xa/49xGCLKzdmXLkcYU4XklXfT3TvmSVTHe6Pk zqaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3wmDkHV8HYzOWhuknNT6kESrRfuVs+ZalyBRjyshycQ=; b=utwOG5PAgThnG/q4ZSv5OPzB4VEN/17Bg77vfLTDRh6vM0tL9xmGyJrNyPTlcWh5FK ASLAGtht2xcKOMBG7AQS0j3X6RtMR9l8N+Ud3xGP4Px9kSm8FgrNlQpKlRyqSrWQEgVs sWqJxLEnDJFGbb2HOohYjol+h9efSbTujXyI5NTPdOrrMEdtybKrCex3eqcebbuZDAkK IQM3M+y6Fv95tsdYDJfnyg92pClZaVk7eDtfFu83tuBmdxHYcVuQwGbOwoZa1nAYJ3uT e/NF/4epUfGumDcIK7kLD5dOhRVsKGNM+r8oqVuWcQZHjjo+TABy3irTF2EXSuyjmkCK KJwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=QOPYTLQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pj3-20020a17090b4f4300b001fe0af5ee6dsi1612010pjb.96.2022.09.02.01.10.39; Fri, 02 Sep 2022 01:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=QOPYTLQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235473AbiIBHwD (ORCPT + 99 others); Fri, 2 Sep 2022 03:52:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235297AbiIBHwB (ORCPT ); Fri, 2 Sep 2022 03:52:01 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD4B0B5A5E; Fri, 2 Sep 2022 00:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=3wmDkHV8HYzOWhuknNT6kESrRfuVs+ZalyBRjyshycQ=; b=QOPYTLQQBdugxke0Jed5tVajAz BHPcuU41BYkmsix8MMuJUralRZ3s0p+44/b3ai+cSnTWEw1Gx9mur7o9Ms2j7PzjxJ5QyvBrAMeDf Fh9w3eCylClGKxuqaLtvAqJVbHRnqdJvQh4KRWzc6wmrt/ax6BPlHpLRLsy1myKQcs4xt5HljQDIK gvaG6z+LHA3AMZR6TKAaSx90YNElwX3eF0tLzTjKjjTma64WahqyKGk9Sgm25QgMVqbgq6FG6iUMk SdmCWero8BR0uy5sSyKM3rpnQAREjnY5thyFMsYtsOy9p30NuzvO/v3UOcRnsGSN8q3waHtImiccj vnyGe4yA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU1So-008cEY-St; Fri, 02 Sep 2022 07:51:43 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2F7BB30010B; Fri, 2 Sep 2022 09:51:42 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E75CB2B852D7E; Fri, 2 Sep 2022 09:51:41 +0200 (CEST) Date: Fri, 2 Sep 2022 09:51:41 +0200 From: Peter Zijlstra To: Sami Tolvanen Cc: Nathan Chancellor , LKML , Kees Cook , Josh Poimboeuf , X86 ML , Catalin Marinas , Will Deacon , Mark Rutland , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel , llvm@lists.linux.dev Subject: Re: [PATCH v4 00/21] KCFI support Message-ID: References: <20220830233129.30610-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 01, 2022 at 05:33:29PM -0700, Sami Tolvanen wrote: > > I do see a few new objtool warnings as well: > > > > vmlinux.o: warning: objtool: apply_relocate_add+0x34: relocation to !ENDBR: memcpy+0x0 > > vmlinux.o: warning: objtool: ___ksymtab+__memcpy+0x0: data relocation to !ENDBR: memcpy+0x0 > > vmlinux.o: warning: objtool: ___ksymtab+memcpy+0x0: data relocation to !ENDBR: memcpy+0x0 > > That's interesting. I can only reproduce this warning with > allmodconfig+LTO, even though the relocation exists in all builds (the > code makes an indirect call to memcpy) and memcpy (aliased to > __memcpy) doesn't start with endbr. I'll have to take a closer look at > why this warning only appears with LTO. From just looking at the patches I'd say patch #19 breaks it. IIRC you forgot to make the SYM_TYPED_FUNC things emit ENDBR. Look at how x86/asm/linkage.h is overriding SYM_FUNC_START*(). You might have the same bug vs ARM64 BTI, they do the same thing.