Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2602788rwb; Fri, 11 Nov 2022 11:44:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf6lEqEHTNlYFVSwSnL6v06e73Krf5ztVg36v9QwU4XXa2Sgr1GhCduPlC1W8JJgqxUwVqiY X-Received: by 2002:a17:906:a1c6:b0:7ad:d250:b907 with SMTP id bx6-20020a170906a1c600b007add250b907mr2957594ejb.737.1668195880268; Fri, 11 Nov 2022 11:44:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668195880; cv=none; d=google.com; s=arc-20160816; b=L9htFOxujSUWMLStvzxWTcbGTeIAOqi0libcyRKnViDgLTYcI4DbgBstrFbDk5ymTh kxDk/QTi1SXlDLOKl45RRhKGhW05rAaRHtV56c01J54A0vpMXB+WmKMYbwzuNoufwMTp 01YHiBbCoqnosDnv1iVx8NvSKCC3ZYpjOSMp7m4QOI2pdAfsVfn1fdJ1jOQYTGLTVrYN qV74eqOhPVOUzY+tzxC5onstaUmZRUwR/2FkRRfdUt95Ox7w0zadkLZN3SABHeRxbJoW f59lL1c3nmC527j8E7AkwDHJXrZ7EB7jbhuHb7OiE2R7DyqRGTeFpCG4PSUPid+jdUzI Nfdw== 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=Xt34YV/MZZV7jS+W7OwiyVMKxHZ9NnWwfH2nxadlAxU=; b=CQ8dbsNHdiJSblotiOksBPPXMMXWLofA6+Nl7PQrndOfoZKgA8VpusOFTzLYZtD9+0 7GFMhFtgYTtoIU49DLkTNo3oBx2yghdoTaD7bZoo3g/PA2VWbfVrZ4uX1wGSdBmIurGA 1R9s8WIyk/K5TYlaf5SMLMpYzoG/giWxpNBqVlluEmBecP/Bh7xq/AMWy0MPuvQZm6j1 QUrjBnMh17tH+FvQ+a+iaBR73inyCJgC23Uej7H6s4+2WOhzrZj4yfLevhZy6JNztoW2 wMrBFA/gaGlNwCBnAnipVyHCg5Du/1RQlEgIEE7vCmiys+9iFUpmu3foZGyjOF02L+o0 lJLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="W7/H5ujz"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd22-20020a1709076e1600b007ab1b8b71a6si3193423ejc.40.2022.11.11.11.44.12; Fri, 11 Nov 2022 11:44:40 -0800 (PST) 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=@chromium.org header.s=google header.b="W7/H5ujz"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbiKKSc7 (ORCPT + 90 others); Fri, 11 Nov 2022 13:32:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbiKKSc5 (ORCPT ); Fri, 11 Nov 2022 13:32:57 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2E035B5A7 for ; Fri, 11 Nov 2022 10:32:56 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id 140so4108121pfz.6 for ; Fri, 11 Nov 2022 10:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Xt34YV/MZZV7jS+W7OwiyVMKxHZ9NnWwfH2nxadlAxU=; b=W7/H5ujz3DpGriSq86yiYiFYWYn/JcloeHWl05yqWHS+xIMd87ea4LAtjMK0+9ZxXi 2OW5d+S1bLlyWclTcsFjipuxKIrB9vnuqOXu/Tl0SSIzm3nxcrOUgYcfoH/DznABkSf9 Y6kXj8prg7D2DrEXqrsIrb1vYxXuqEA1PqCb4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Xt34YV/MZZV7jS+W7OwiyVMKxHZ9NnWwfH2nxadlAxU=; b=rk7TE21Vzp46Y11IWx3nsYrPH2I73elYlc6jad+nOd2dW/r++lubgBk5ENNVv7T2Fh R5qr+PB+yQjK4K9sS41sXRenuJ2gOAYhl8YR31QN5poXZrJAc2cD/o3qW00P7U3hNlmP ZeYJwyZtDi11+1O5sUPhi6lUu+L5fi2YPzM/Z8nMRICdZQIue25uPiP6TrMD85c5n4dz D7d8NfpW/HIlEAFYkCy8FFe+jwtA4+zt/GEDqVLJlkYA8Xbq5F4EKzLsPKw0oSpLnkAF A0h9YbxVhrbB9BIC0UDbyqxeFRSjf9Qvxf7eXJQQpUmFATLqUzUbOL8+lqniWHenmFRc vqcg== X-Gm-Message-State: ANoB5pmpTChMbnhFSeqGbTeUB/QzQ2Eli8J9CnKpuq06utuKu4y3eFeh Qs6o3aEBW112wM7WCW0Zv+K/kA== X-Received: by 2002:a63:fe51:0:b0:459:a339:89e0 with SMTP id x17-20020a63fe51000000b00459a33989e0mr2758570pgj.300.1668191576394; Fri, 11 Nov 2022 10:32:56 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v10-20020a17090a0c8a00b00205f013f275sm5157870pja.22.2022.11.11.10.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 10:32:56 -0800 (PST) Date: Fri, 11 Nov 2022 10:32:55 -0800 From: Kees Cook To: Sami Tolvanen Cc: Peter Zijlstra , Mark Rutland , Catalin Marinas , Will Deacon , Steven Rostedt , Masami Hiramatsu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER Message-ID: <202211111032.BBEEDFA0@keescook> References: <20221109192831.3057131-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221109192831.3057131-1-samitolvanen@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Wed, Nov 09, 2022 at 07:28:31PM +0000, Sami Tolvanen wrote: > The 0-day bot reports that arm64 builds with CONFIG_CFI_CLANG + > CONFIG_FTRACE are broken when CONFIG_FUNCTION_GRAPH_TRACER is not > enabled: > > ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph > >>> referenced by entry-ftrace.S:299 (arch/arm64/kernel/entry-ftrace.S:299) > >>> arch/arm64/kernel/entry-ftrace.o:(.text+0x48) in archive vmlinux.a > > This is caused by ftrace_stub_graph using SYM_TYPE_FUNC_START when > the address of the function is not taken in any C translation unit. > > Fix the build by only defining ftrace_stub_graph when it's actually > needed, i.e. with CONFIG_FUNCTION_GRAPH_TRACER. > > Link: https://lore.kernel.org/lkml/202210251659.tRMs78RH-lkp@intel.com/ > Fixes: 883bbbffa5a4 ("ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()") > Reported-by: kernel test robot > Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook -- Kees Cook