Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2060552ybh; Tue, 14 Jul 2020 14:43:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEplx73O/3yC791skc3keBnrWfRG6Fm3DKoxnAzDuSj7J8XtoVsz6rSXVQIFcbl+Fz6fWo X-Received: by 2002:aa7:c991:: with SMTP id c17mr6625273edt.278.1594763010806; Tue, 14 Jul 2020 14:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594763010; cv=none; d=google.com; s=arc-20160816; b=MFr+Z7bHrjJyYRRsHGfDmfs4TCy/ugma0l2ZYiaGxvKEIOS4oc22nzMIyGjlXrR/PN euUDs8Icoh35229wY4gKFv8AmNZxBF35ZeG2LUunp01pk6mGm7NNTdry0z+Hxo0Y3QF5 JnZ5yb6GEkqvwJe6hgrgliP2C/u8USfhuCTzRoNAvdMjubAaJP/BE6C+I1+P4likbom9 m377ieHe8DpCrm6B8SAYxyCH3QDa3TXLKgj0e7WQT6KdD4c6SLyM/BVXc/ItYxnzQyas Ku7L6WU4fTdlwhzvzYkSUIe7tq1xMbTdVtwYkFsGCRE2xp0ySS5F2wDEuZl31+S54o/w HG+Q== 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=dch/WtmoKPQg8SRn/xT9XuWPxCjeN6BPw/5vBDMLPao=; b=Eq12gwWZTQLK09NMmUm+8+QPIEtlNjdrCvR0jF+Y4WiiSt5iQA7lyA398rulXGClOk HfQrqAhnXgHd28FYzpIvgOytS3IgvFcf0RclGaFRtH471slfX411JGbXaB89pbi1IW7C 6cQ4dPjc0EiqRvN2Pb/1F30K7YL/sz7Tv3exAaACqwJ+MbeaFOLdRG4jEhPkg6kQYI8e gdtAs28bUx26ZQHjYleT+G/y6ml0SJx36N4QcOy0t2YGbmJ86PHApuC78Yf3CqcSxvSw x9twoeII/XKGXJsmLjo1kQRx/pzO8U2cMLs5JayqgsS5/slQlrdD2ql/QpcQS45ZdyC+ 4zww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rHWw0+X+; 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 rl28si1426ejb.353.2020.07.14.14.43.08; Tue, 14 Jul 2020 14:43:30 -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=rHWw0+X+; 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 S1728145AbgGNVmw (ORCPT + 99 others); Tue, 14 Jul 2020 17:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726710AbgGNVmw (ORCPT ); Tue, 14 Jul 2020 17:42:52 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDFA9C061755; Tue, 14 Jul 2020 14:42:51 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id d27so108241qtg.4; Tue, 14 Jul 2020 14:42:51 -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=dch/WtmoKPQg8SRn/xT9XuWPxCjeN6BPw/5vBDMLPao=; b=rHWw0+X+zL9ddXJHGLNV7xjzS0eiiSQzcypjCMxbHGz22QkSRGXXtGnRd5MDjvk7/w yqnU0NnbElreflfaS590bj4ZlPOfQscv9mmhaLuVFnjCnnX70y93TcNWen9KB9qA3j6v 5k5zMDHrlXQtdJev+EzUYEg+wSUacBRYApl4QSD7d5UsB+Pz9ekk4+G1TEvXZI6WctXq mzuyNHyN5CBkVGUnVqAPJHAlOqVM/pngl0NgtFvLyiOIgHpmzhu1Hub6OG/TkCjExFRo Oc2xQIjZmNemXiXFrUkSzaIN9xnFuR1cD4FUPOSS4OOBE2IiALEb0VieY+zVzgse88y5 gCVg== 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=dch/WtmoKPQg8SRn/xT9XuWPxCjeN6BPw/5vBDMLPao=; b=qKTt6KyquWNTXQJfh/zwxaHVpnQ0FQbVG/4bKxNaA5PBXaatmOHh55NsgyanQ/BNBP AmfEJb7LxqTItFa9IoIh7uxP0MhCb2NwHJ5shZR4TF+CDs0h8X2AN5fT5UlziOz59Am6 AooPg/Vr30ePKouPXspyvyandYusdJirLb8HUdzdkRGHVpn8bJ8neo+Fk2LOM+8J1NrC Pwra3QNajB5qLVJf1tI3oQPvL+gM23KgEI5KiC6bT2FayB6InHuskLDN5krDg+JAjNsa 6QOEYOY23+3pF/YHOR2XtQnIKpIE1nR6LeBhSsUkbTovHnsj5m3gcuAUgfA46Uhx/LNZ NijQ== X-Gm-Message-State: AOAM533L7uaUhsEa0SkpL18TvjXTL/+nqma/6pQE2Pc7PcWVMzC7Y6aZ Gt0jW+DELYFnPpW7XK47VrE= X-Received: by 2002:ac8:4ccb:: with SMTP id l11mr6786726qtv.18.1594762964831; Tue, 14 Jul 2020 14:42:44 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id q28sm377002qtk.13.2020.07.14.14.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 14:42:44 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 14 Jul 2020 17:42:42 -0400 To: Nick Terrell Cc: Borislav Petkov , Thomas Gleixner , linux-kernel@vger.kernel.org, Chris Mason , linux-kbuild@vger.kernel.org, x86@kernel.org, gregkh@linuxfoundation.org, Petr Malat , Kees Cook , Kernel Team , Adam Borowski , Patrick Williams , rmikey@fb.com, mingo@kernel.org, Patrick Williams , Sedat Dilek , Norbert Lange , Andrew Morton , Alex Xu , Nick Terrell Subject: Re: [PATCH v7 2/7] lib: add zstd support to decompress Message-ID: <20200714214242.GA1000731@rani.riverdale.lan> References: <20200708185024.2767937-1-nickrterrell@gmail.com> <20200708185024.2767937-3-nickrterrell@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200708185024.2767937-3-nickrterrell@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 08, 2020 at 11:50:19AM -0700, Nick Terrell wrote: > From: Nick Terrell > > * Add unzstd() and the zstd decompress interface. > * Add zstd support to decompress_method(). > > The decompress_method() and unzstd() functions are used to decompress > the initramfs and the initrd. The __decompress() function is used in > the preboot environment to decompress a zstd compressed kernel. > > The zstd decompression function allows the input and output buffers to > overlap because that is used by x86 kernel decompression. > > Reviewed-by: Kees Cook > Tested-by: Sedat Dilek > Signed-off-by: Nick Terrell > + * > + * __DISABLE_EXPORTS stops zstd and xxhash from declaring themselves > + * as modules by disabling the EXPORT_SYMBOL macro. > + */ Hi Nick, this doesn't actually work, because misc.c includes export.h via "misc.h" -> -> and EXPORT_SYMBOL is already defined before __DISABLE_EXPORTS is defined here. Adding -D__EXPORT_SYMBOLS to KBUILD_CFLAGS in arch/x86/boot/compressed/Makefile fixes that, and then you don't have to define it here. Also, __DISABLE_EXPORTS does not currently inhibit MODULE_INFO, so a .modinfo section gets emitted into misc.o. I *think* this is harmless and it will get discarded when building compressed/vmlinux, but thought I'd point it out.