From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92C79186F for ; Fri, 2 Sep 2022 15:40:07 +0000 (UTC) Received: by mail-ed1-f47.google.com with SMTP id r4so3197583edi.8 for ; Fri, 02 Sep 2022 08:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ZZViECBQIPeE26/U6PwpBaWGPbv4WEHDCGVI4qLmJb4=; b=Hng+Qdrwf6aoRL5qjOrDdX9dneBrnXK9dEZGpGEBFIBlyH39qCfY8ZchTBiQ96Q0QZ mo1ow8E2D91zJz9YHExUeoBbqrfgZfUkW/zpThocnMs6/uZURRu3lnitylvOlee0a2YS lKyPusHcdynwJfmX3iErtGSVR6WZ0pz0wERuQ+gOVoitU+TXKIMwyvIXxJ6kk3/xB1YN jVYY2LL5WiN4duAlJTouZHUSOGLWZAnS3r024F5fHcDu6W/sH2j8IaYiIBvia+Jl5ABU AzAcOSRqtsQoQZ3ygVlgucKeGyZsGK/jQqOSKFjZ+4s4BXtjIAoDokHMGxn5B73siZhJ rs6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ZZViECBQIPeE26/U6PwpBaWGPbv4WEHDCGVI4qLmJb4=; b=Kme9k/SEKI/i+oGMHRW0mHjjcBwJROO8CmXzEPRPUuDTTroYKcRsLjVoDrgQXedTmb mO3Lfd9+3VysrqXMtmCDzqeL+8ye54+5OwgfRt17X6gD6DYvJts7mfFjSfHRkMhqEA+b Ge+CP02mkApiX6fsob+Mws75UnNiDSCzSsr6wvlpLg33B2t98e/nGa8POaUGVWeNrfUX JETmlULfTZR6/gsABJIJ+10FchmwCK7rJ0yoNJkuWSL0kWEtMbN6jRpUpivN8f9cbyXX 1sx+a584uPRJV6isguw7QXHQK50EOLZwsVjbGAuWS/IyYB+2rLOfgq/s+Ngya5+AzoHb OFjg== X-Gm-Message-State: ACgBeo2iFU9erFLXIAcS+PF7OOfInCYn4tuRYNPsbLktlgt9WdsquWeN pAFpiMVhsloIV9rFQux0Dh/IpfLj8s46mP1HfcO0yg== X-Google-Smtp-Source: AA6agR4xxlZQqkE3iOmxpnuJDnHFAJqpyc3JD/HdUdWEisfmE3Z6rtHXdERjcLrMLI5v9gj6USv11x2Cp3VoRzACFOg= X-Received: by 2002:a05:6402:3227:b0:448:706c:185d with SMTP id g39-20020a056402322700b00448706c185dmr20812932eda.357.1662133205628; Fri, 02 Sep 2022 08:40:05 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220830233129.30610-1-samitolvanen@google.com> In-Reply-To: From: Sami Tolvanen Date: Fri, 2 Sep 2022 08:39:29 -0700 Message-ID: Subject: Re: [PATCH v4 00/21] KCFI support To: Peter Zijlstra 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 Content-Type: text/plain; charset="UTF-8" On Fri, Sep 2, 2022 at 12:51 AM Peter Zijlstra wrote: > > 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*(). Yes, that's the reason, I'll fix this next week. I was mostly wondering why I'm not getting this warning with my other test configs, but it looks like IBT isn't enabled by default. Sami From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36A65ECAAD5 for ; Fri, 2 Sep 2022 15:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RtjmwUXkLy7RXQb+kn8mWp9R6fRfHfFPF+d3wZVoTkE=; b=tTcCNI5Y3WYEtJ rtug+MU2Pe3ipRyFH+fuola9apBVAvtpXFXWIoLD/J/evyq6gpMjq6N/eih5E4lTSSDgytMgwNHNF k+AoEE4trx5GanYK7WlwuYnh+cC+wISBecyD53Pw/chQBAcYUfwg7t0xYP92TKQMMu2Gka55aVyG9 p0kpNJAIOHblMDsVuf3KLNjqlEvAnnER7usjCQpcdsiJkOz7tPVGphHUGPxKIc89MCL+L5M46KKMo 5SDAi5sAjVAOYucnyfSPj/Bz/vvAgachBI+thi63dZaYoZ8KxPADRTn7v7k/uzEljR7NlYnrgTXvx CyQG51eDHydL80uBZI8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU8mF-006KW9-OD; Fri, 02 Sep 2022 15:40:15 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU8mB-006KO4-OP for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 15:40:13 +0000 Received: by mail-ed1-x531.google.com with SMTP id b16so3215751edd.4 for ; Fri, 02 Sep 2022 08:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ZZViECBQIPeE26/U6PwpBaWGPbv4WEHDCGVI4qLmJb4=; b=Hng+Qdrwf6aoRL5qjOrDdX9dneBrnXK9dEZGpGEBFIBlyH39qCfY8ZchTBiQ96Q0QZ mo1ow8E2D91zJz9YHExUeoBbqrfgZfUkW/zpThocnMs6/uZURRu3lnitylvOlee0a2YS lKyPusHcdynwJfmX3iErtGSVR6WZ0pz0wERuQ+gOVoitU+TXKIMwyvIXxJ6kk3/xB1YN jVYY2LL5WiN4duAlJTouZHUSOGLWZAnS3r024F5fHcDu6W/sH2j8IaYiIBvia+Jl5ABU AzAcOSRqtsQoQZ3ygVlgucKeGyZsGK/jQqOSKFjZ+4s4BXtjIAoDokHMGxn5B73siZhJ rs6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ZZViECBQIPeE26/U6PwpBaWGPbv4WEHDCGVI4qLmJb4=; b=6l2Wp15krOB57l2QZ4xfiGV92+5TKkYADWgGmJC6GFTx4MXJPlv19P2SEQCYnybR5U 9T4CLnRhMV7AiIk7BEZaBDXsPnI1leSwOFmu0lBuIFxKbQymj/PHKeOX1CGuwH1Q+YqS 2n91psSUDGotMvN9PsNJaPdCSlqkM4Lo5bFAYFoD/u5oMvyn0N9IW0gGfCZnlui2ZZGn iyceEgtK3kZn2Qfu8WJUQAYlHjc6PIW2cq90cmoksx5Ur6OH94IBG/WOfcFhj2MkHTWs KCN1fNMW+PpDYyUezfBTFYuw3ZTIzPAMtsQIWpgYnkDgEnC6Xcxz9tgSphWIWgJjP4U5 zG9g== X-Gm-Message-State: ACgBeo3KyGTV3frG5zvVcpIAeBj0W+WkZoORBDMw7aViyJtosD5dTK4H aF9Engby7B0eD7SLyOsUySPPyh+IOHJ8di2a3UlY1w== X-Google-Smtp-Source: AA6agR4xxlZQqkE3iOmxpnuJDnHFAJqpyc3JD/HdUdWEisfmE3Z6rtHXdERjcLrMLI5v9gj6USv11x2Cp3VoRzACFOg= X-Received: by 2002:a05:6402:3227:b0:448:706c:185d with SMTP id g39-20020a056402322700b00448706c185dmr20812932eda.357.1662133205628; Fri, 02 Sep 2022 08:40:05 -0700 (PDT) MIME-Version: 1.0 References: <20220830233129.30610-1-samitolvanen@google.com> In-Reply-To: From: Sami Tolvanen Date: Fri, 2 Sep 2022 08:39:29 -0700 Message-ID: Subject: Re: [PATCH v4 00/21] KCFI support To: Peter Zijlstra 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_084011_804122_F2C9DA82 X-CRM114-Status: GOOD ( 19.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 2, 2022 at 12:51 AM Peter Zijlstra wrote: > > 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*(). Yes, that's the reason, I'll fix this next week. I was mostly wondering why I'm not getting this warning with my other test configs, but it looks like IBT isn't enabled by default. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel