Received: by 10.213.65.68 with SMTP id h4csp329166imn; Fri, 6 Apr 2018 00:29:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx49xm8QwmoZ7bsItVwHLlYvxb68kdvx7eeNtt1PjIVWmCq6z+h5UL+ejvrfnwBgHFt1hDLAl X-Received: by 2002:a17:902:887:: with SMTP id 7-v6mr26583821pll.319.1522999767712; Fri, 06 Apr 2018 00:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522999767; cv=none; d=google.com; s=arc-20160816; b=fv85fCnFoAyArqRnjvTipRDwopoED8SHFRQXhla+czbBaaWfXBn2/DE9hHOg85LmtN cTbevUGYrRCkacqnZ0DxfxON0kTV/fhLVLT0f9KueN6Ft0LG4BQtE/jROpk6aB6fKWfS oJXkc1u+5t2acjPN99sWCq98KMo/mVajNRxYXh4hP6s4jZ+3cQWB/m9ysEwzs3SAHotq qzYBpAJrs11TPgwwy4nD4bzoENPJmy1Bfgh3EfydI+g5QuaHB9llhuJ4DtO2ncr6nn5g UTLvc+HxpJCS/yxilsLZR00XJjVrZI5Znq74vrFx7YrEzeXY8ngUEJp2Rt/f2d2BkMgI W8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=fcgm9w+Eb4GyST1OlHJPNux1fSdcZf8NLZ/EqUTnkLQ=; b=ylyhk1nhWDkCBg0cDe10qU+uSxDYF8vMKaILEuFIdJWyCdSZ84kiI+Fhjap3rGVQg6 dEVDD3OEHLVCmtofNRmKFa5SYS8zkfv6NqLJJdAZxfDLFOA/BBEnotU1R6XGYIhzxAS/ TloGzH8i30JjCVM/X1EsowBT8O+mtFnUNv6oxYrrxgOKf3qLWljlbJB1wO/bNg8w9O96 A7Vs9ahv2kRqaUlPa8T+KIGYgVw0+uCzogZUprmfI93LYTZNaw9PH8JBWXrz5OW132aw 1tjb3Nba2vBZ+e/iROHKAplbzHWek7MAw5Yz9kkgTJHLk9Ucofd/XV5dv3w0p8GBEzGJ nr7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PVWvVyUC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21-v6si7547775plo.225.2018.04.06.00.29.14; Fri, 06 Apr 2018 00:29:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PVWvVyUC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751432AbeDFH2E (ORCPT + 99 others); Fri, 6 Apr 2018 03:28:04 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34603 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbeDFH2D (ORCPT ); Fri, 6 Apr 2018 03:28:03 -0400 Received: by mail-wm0-f68.google.com with SMTP id w2so6798997wmw.1 for ; Fri, 06 Apr 2018 00:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fcgm9w+Eb4GyST1OlHJPNux1fSdcZf8NLZ/EqUTnkLQ=; b=PVWvVyUCJpG4wfvrqLSXedpysMMGhHWa2E70QMOrO8cYYwQHG82T1uabNeQzlec+fK Z00i70/FDW3FKyeyxKwCnUTARt1RGIRNKjKOADjI0kAdNVd+QOYKzqQiwpVzOsoVj/NT 0ElXN/b/gRrotOR5q8IYbwNdp53g9FqP0wFgV5e26viNY20HYyfcF/8AumnlsmKMDFju 5YYqAD4u7J1aa7OYQAIOOCuwswcRwX+d8mgV5Oycdly0IEhP5jvVZMhDwUFq+jnyRz2b l0lNkt9Rfc/xJ9LRWz/NTbT9tJYPnTqyikC/rqD6blTar/rWyma3TkSwacyqQPbyRsI7 xHzg== 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:user-agent; bh=fcgm9w+Eb4GyST1OlHJPNux1fSdcZf8NLZ/EqUTnkLQ=; b=C62k7JAte1oM9RcPPPB6jYwoOQmALwinozVTIJaS5NdJ34/3U/ci2N7u3LmCzFz7Gd XnLTDZWMkcxFQYWBTcGGX8SFAIysXBVKauwrXYYJ3LR1zkA/PvT4KaNas5tN0upVhkCh 6Dx+bE9vTib3gC/2ef31ejnOA+ssnRW3M0YMewQmGoF41L/g+wmOKwFY05ZxUK10AEbG DVg7jqcb/g3niK0/ZiMKG6j7K9PJDJcqyJiCdDPq5WH8giohf292+sp71f7vvMASLdXy eRWEuViaZ3AgiDgItvjjAckfhsQKRk5bNdA5UHJt9S4pE7z4cSoC4R5++xw5DzeqFNWf WCFw== X-Gm-Message-State: ALQs6tDbpWluqD9WPTsFrk2J/UULKopQU3sNuZliLcyoSNLnfuk4kJn/ M8wiSCnn9EMTgvEK0bB7K/7lZGWlbkk= X-Received: by 10.28.12.17 with SMTP id 17mr11764011wmm.75.1522999677267; Fri, 06 Apr 2018 00:27:57 -0700 (PDT) Received: from [127.0.1.1] ([83.243.48.55]) by smtp.gmail.com with ESMTPSA id r196sm6458267wmf.9.2018.04.06.00.27.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 00:27:56 -0700 (PDT) Date: Fri, 6 Apr 2018 09:18:39 +0200 From: Tobias Regnery To: Arnd Bergmann Cc: Kees Cook , Linux Kernel Mailing List Subject: Re: [PATCH] pstore: fix crypto dependencies without compression Message-ID: <20180406071839.GA3685@builder> References: <20180406063804.30510-1-tobias.regnery@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.04.18, Arnd Bergmann wrote: > On Fri, Apr 6, 2018 at 8:38 AM, Tobias Regnery wrote: > > Commit 58eb5b670747 ("pstore: fix crypto dependencies") fixed up the crypto > > dependencies but missed the case when no compression is selected. > > > > With CONFIG_PSTORE=y, CONFIG_PSTORE_COMPRESS=n and CONFIG_CRYPTO=m we see > > the following link error: > > > > fs/pstore/platform.o: In function `pstore_register': > > (.text+0x1b1): undefined reference to `crypto_has_alg' > > (.text+0x205): undefined reference to `crypto_alloc_base' > > fs/pstore/platform.o: In function `pstore_unregister': > > (.text+0x3b0): undefined reference to `crypto_destroy_tfm' > > > > Fix this by selecting CONFIG_CRYPTO unconditionally. > > > > Fixes: 58eb5b670747 ("pstore: fix crypto dependencies") > > Signed-off-by: Tobias Regnery > > Thanks, I wonder how I missed this one. Thanks for fixing it up. > It's a bit unfortunate that it now disallows the otherwise valid > CONFIG_PSTORE=y, CONFIG_PSTORE_COMPRESS=n > and CONFIG_CRYPTO=n configuration, though. > > Could we do this by making the calls compile-time configured > in the pstore code instead? Please try the untested version > below. > > Arnd > > diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c > index 1143ef351c58..dc720573fd53 100644 > --- a/fs/pstore/platform.c > +++ b/fs/pstore/platform.c > @@ -258,7 +258,7 @@ static int pstore_decompress(void *in, void *out, > > static void allocate_buf_for_compression(void) > { > - if (!zbackend) > + if (!IS_ENABLED(CONFIG_PSTORE_COMPRESS) || !zbackend) > return; > > if (!crypto_has_comp(zbackend->name, 0, 0)) { > @@ -287,7 +287,7 @@ static void allocate_buf_for_compression(void) > > static void free_buf_for_compression(void) > { > - if (!IS_ERR_OR_NULL(tfm)) > + if (IS_ENABLED(CONFIG_PSTORE_COMPRESS) && !IS_ERR_OR_NULL(tfm)) > crypto_free_comp(tfm); > kfree(big_oops_buf); > big_oops_buf = NULL; Hi Arnd, this seems to be the better fix, the link error goes away with this change. Thanks for the suggestion, I will send an updated patch. -- Tobias