Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp199894ybt; Tue, 7 Jul 2020 20:27:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCIlfqLDc/vvUM0X/am6DEzUPKhZvGPw9ROLyAjW96sr/1hJAobZjSkidABZznINkoThaA X-Received: by 2002:a17:906:6847:: with SMTP id a7mr48638174ejs.306.1594178840299; Tue, 07 Jul 2020 20:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594178840; cv=none; d=google.com; s=arc-20160816; b=CdgxR6jPI0vs3/Cl1S5A8ZQzSFnJ0BTn29i8a5DCO89A3qV62ae30vk+GukArdGTwO mK/+Ci6xKJm/xGX+NpqUnQDNJ4KywyGW/NsKln1fq2g8D3v1r8+UU+KOo2pW9K1puErb LfLcxe0iq+l3PUiPY0PlAyCNP8m4PxlpH26jAvWstfMSsdLWt5Hiptx8vP/vYgo4COwp bgRD6Xlnufi6JefE9V5vj1ZWoCXHXFtRhp3qPwbtCKciUevjLLoZgTaBodqzGOgbAtrr MvMRnghSCgzGN7RwHvYoj5QiZszFHN64OhXAMp1QGkmn8wQaNSmcs9+ye+102Q7TGPSG etgA== 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:date:from :dkim-signature; bh=0tB4yD5kInlZmy1upi23IYYVXDZraVGUBEv20VlqeTE=; b=N/QWEOeaJisxA6jGceWMYfL1FmsUnCYjlS9FhHp6KY5uOBK8umpiHTznBLZUkshjYx ERs4X83cdiJEMja0V1XOL1eWc48rlmJHagz/cw7jHQU7xurQr0CO6hEl4ZN8pGJSLqfQ gER3Hwocc+bxkY04WTD/WXHhFaA8XUT/Qcu5NUBVXi+f/JYoxvog+MThg5rhHlYvPnTy xnMGYYO9TFd4+eWiDL2nZCWwRZdV5sVxwRxgSeWYYrIOnfF+m31ikOMNvoOt2G7Jdlic L6ZRU4D5hUMQrFVZ8oFjvWF8NeHPiFLvOsY5pyl8m6GosGKxv58PAQSQypmoSFnWsi7g vDfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=VK2rzIej; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si15448320eji.501.2020.07.07.20.26.57; Tue, 07 Jul 2020 20:27: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=fail header.i=@gmail.com header.s=20161025 header.b=VK2rzIej; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729095AbgGHDXd (ORCPT + 99 others); Tue, 7 Jul 2020 23:23:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728061AbgGHDXd (ORCPT ); Tue, 7 Jul 2020 23:23:33 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD1EDC061755; Tue, 7 Jul 2020 20:23:32 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id t7so19852774qvl.8; Tue, 07 Jul 2020 20:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0tB4yD5kInlZmy1upi23IYYVXDZraVGUBEv20VlqeTE=; b=VK2rzIejF6RAq9zDQnBEBxXLePiSGScgzCtI4kUlohWOu8Ea3Nd3R2/K9XzhqsFVCK JDzEg4s4EwNUne3GplxSmEbcwHrVCTNqjA83EqK1ifBb5+JnOhtCxabCMzsibIfqNsvC AYzRqR29Ne7LnPCaDmeFFwVSaV34rOohdRD9mlIASCppx5JbPFHFmzpv1Q6KGbJBlDVn LycBAohVRkR64f8ij2TONkYdp69WvGR8Lb/3ag0RKcsuqBB2GUPoSJdwEEY81YKQvdDB 3nA2XY+qE1IOA1M6sNcKH2RHJrxjmwpuXoyox2nkyf3MlN4loLS4xXc9BeHkyf37lKzB DiCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=0tB4yD5kInlZmy1upi23IYYVXDZraVGUBEv20VlqeTE=; b=qMUAnrfYCoClycgMNX1o7dBxB57sNWZiN+k+HMK8pCC1PKKXfWQmYFReDDrSCRMkYN M98KfxxvCDCsxval3rQ2lPwgO7P8336ob7FHUTjsf+PeVHe3qlDpuRxw7dAvoiGcujT5 uXLRkLf3Qcd/eNg67muMobHV7GJACwPYf8K0GCjmJfmQkf1royh/IApCG7x1DKP5284S 8X1srQ713FkFORoDNZHcTJi3KVNPkSIvqbchHd91WXeTEglIiQkBpBkTP2pXXixJfh4J wYY9tyfxiKu8eGteRizzZmm1ojKAxNAdjboI5Xb5qhfucZ4WvUWyZma7XxDh4iFEuvSu yS7w== X-Gm-Message-State: AOAM531POu0wFOnvR/aKWxV8JKYKFtYXn4YxTctN46PytJ9teWfpLVhB +959LM/Mquen4mPrtzP1qC8= X-Received: by 2002:a0c:e78e:: with SMTP id x14mr38208940qvn.65.1594178612000; Tue, 07 Jul 2020 20:23:32 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id h197sm25525655qke.51.2020.07.07.20.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 20:23:31 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 7 Jul 2020 23:23:29 -0400 To: Kees Cook Cc: Arvind Sankar , 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: <20200708032329.GB1847378@rani.riverdale.lan> References: <20200707034604.1539157-1-nickrterrell@gmail.com> <20200707034604.1539157-3-nickrterrell@gmail.com> <20200707215925.GA1591079@rani.riverdale.lan> <202007071947.5E9723AF48@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202007071947.5E9723AF48@keescook> 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 07:49:25PM -0700, Kees Cook wrote: > 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 Looks like Ard added it a couple of years back [0] but it got used only for the EFI stub and not the decompressors. [0] http://lkml.kernel.org/r/20180704083651.24360-3-ard.biesheuvel@linaro.org