Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp190803ybt; Tue, 7 Jul 2020 20:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaZEzvkQDWejAjRe1e2SFhqNPCF2eWM7wvPpbu5ehpDjpM2jgtShmG2sV4xQWT14m3Jzf8 X-Received: by 2002:a50:a881:: with SMTP id k1mr63010802edc.12.1594177760715; Tue, 07 Jul 2020 20:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594177760; cv=none; d=google.com; s=arc-20160816; b=B6fmIfZ0LtZdPFYuEJONXPJQhb7LhXjAT2lY88CrH4mZgamycRs5gleojRrEw371SY 29I9YXqFr3nNlTfAcbgER9ZL1Uf391GJnMb6Nz6bPb0/0Og+vx9jHk6Y9b0cpURzwoM0 6HuN650+d8KKMPctgGT/3wvYV5ug52fcEQCeeJ+K9yYNtunN52YEV/9Ln9+zzDY0JepM HZHSB9TKomVXJ2CemPveQc3B0kSpwkUc3B8G9VdIRv1zYlCtAwl5xYHpVq2OKqIg1cXC CnLZSsR5Im3ACHv/4AYNtSvIBA/jVj7siYaOREy6TYdFIxPtrkYgizYNZRMDQ+2OCLHm FUmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=oDMKuoobK+wqThSWZV2fTvhky7fucypql6WSexq7SY4=; b=UeY0sLRIVvU9w3hlvhn0SAsZuj7paebBL3Vp+lI58sAKdut2p74g/b/MV+iPCME2j9 yHSGKQZBGjikJP52+bQ9APtNeVs8ppC55ojWsk6wI/K3nwQn0rT3RuTnPI0Ek9eZzdTu /ngg+UZGseDZverEyVHoXLw9mXyzqdFuyStm0+n5EAfhQU/x21/nKxuf62Z6bN7S6iia ln8AaUT8rJo8LDpymxLjrKxkU88ZLr92DTKQDaseXtjK6EiK36CG4BrCoYiWf1D9o0t+ VUJMJDhNQccOsGsZXQAMqUOPnsus9eyd8j82iNPRL3BHYCxd1OeYSXkXEeFD6eV0LxQX 2sqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Fc24JXCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q28si16465249edw.196.2020.07.07.20.08.58; Tue, 07 Jul 2020 20:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Fc24JXCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729132AbgGHCt2 (ORCPT + 99 others); Tue, 7 Jul 2020 22:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728479AbgGHCt2 (ORCPT ); Tue, 7 Jul 2020 22:49:28 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2189CC08C5DC for ; Tue, 7 Jul 2020 19:49:28 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id 1so1599012pfn.9 for ; Tue, 07 Jul 2020 19:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oDMKuoobK+wqThSWZV2fTvhky7fucypql6WSexq7SY4=; b=Fc24JXCHjbpqPEpvXryUfcnNyA2mmorz14N9RlzXJsBnaQdTLSB+0vNa2gElwKFTBq tROEvAxBpwQpNioPsPuphSsbqPGoxKoyKPyUpdbez8qBRHjTBthA8AQIgNXX6dxW8AOP CRHvVbQFe8l2sTYGW/NR2veeV54tHy6AMZ1cc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oDMKuoobK+wqThSWZV2fTvhky7fucypql6WSexq7SY4=; b=VM+PYXnGV7kcrQZ9AGpi2Lr7ghmHWrtYZQ6nAjeXWRxYb8GYFBTkcfOH6rSjSEpnqc dHw/Zi7EO/c+OX7FPMWRQgNBOlkILxRhasJkL1aKwwiNYUMmY//CkW+YVGWGUnxl0OTN bbmkioe+JuRYDU/OAV1pR9SRe59wi5VuqY41/3X01MxKjHbqTfsIEXH7YueA/y4ThwWK 24YZ7yEMH3vXBn2hP7ca4U9/mMnRWEcxQd4VtOhOCq0Y/zHke+G+5iTP6h7EiRL9qFzx hsOgEMXIQ3CBRZ7exnS667qvCkNoAdBIwYqwa9z54nA2T7rKUO6MPSbV2N4suygC4jan gvqA== X-Gm-Message-State: AOAM530jfNqlQeG0K10iIO/aTlDMQPYCfRO2IoWsUQzrT4hKW8/4AvAY X0tue2lXrdIIruYN71IwOD1g+A== X-Received: by 2002:a63:5110:: with SMTP id f16mr46362138pgb.377.1594176567609; Tue, 07 Jul 2020 19:49:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c187sm23031520pfc.146.2020.07.07.19.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 19:49:26 -0700 (PDT) Date: Tue, 7 Jul 2020 19:49:25 -0700 From: Kees Cook To: Arvind Sankar Cc: Nick Terrell , Borislav Petkov , Thomas Gleixner , linux-kernel@vger.kernel.org, Chris Mason , linux-kbuild@vger.kernel.org, x86@kernel.org, gregkh@linuxfoundation.org, Petr Malat , Kernel Team , Adam Borowski , Patrick Williams , rmikey@fb.com, mingo@kernel.org, Patrick Williams , Sedat Dilek , Norbert Lange , Andrew Morton , Nick Terrell Subject: Re: [PATCH v6 2/8] lib: prepare xxhash for preboot environment Message-ID: <202007071947.5E9723AF48@keescook> References: <20200707034604.1539157-1-nickrterrell@gmail.com> <20200707034604.1539157-3-nickrterrell@gmail.com> <20200707215925.GA1591079@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707215925.GA1591079@rani.riverdale.lan> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 07, 2020 at 05:59:25PM -0400, Arvind Sankar wrote: > On Mon, Jul 06, 2020 at 08:45:58PM -0700, Nick Terrell wrote: > > From: Nick Terrell > > > > Don't export symbols if XXH_PREBOOT is defined. > > > > This change is necessary to get xxhash to work in a preboot environment, > > which is needed to support zstd-compressed kernels. > > The usual way to do it is by adding -D__DISABLE_EXPORTS to the CFLAGS, which will > cause EXPORT_SYMBOL to be stubbed out. Doesn't that work here? This is quite rare, actually: $ git grep DISABLE_EXPORTS arch/s390/purgatory/Makefile:CFLAGS_sha256.o := -D__DISABLE_EXPORTS arch/x86/boot/compressed/kaslr.c:#define __DISABLE_EXPORTS arch/x86/purgatory/Makefile:CFLAGS_sha256.o := -D__DISABLE_EXPORTS drivers/firmware/efi/libstub/Makefile: -D__DISABLE_EXPORTS include/linux/export.h:#if !defined(CONFIG_MODULES) || defined(__DISABLE_EXPORTS) But yes, it seems that would be the better approach. -- Kees Cook