Received: by 10.213.65.68 with SMTP id h4csp308568imn; Fri, 6 Apr 2018 00:02:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ntF4JumK1x6/Bm3GsI+peVktAPdSR7fvROwehIQwtP8OCPNfBytReaw0TzZhu0I9bJRm9 X-Received: by 2002:a17:902:ac96:: with SMTP id h22-v6mr25651915plr.93.1522998176281; Fri, 06 Apr 2018 00:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522998176; cv=none; d=google.com; s=arc-20160816; b=tJ1V707rl0mZabHu5vb7JfDHl7DoUco+LrMsrHRvBGxqrmeYAPNTzBu5D55PEhB28K 7W90G/inUrwOJ9UDpZUuQokB5WseiS3z33prAM/+NqvJq2dUaFsxJOaNuyqSb9Tdfk2R toG3BJuFxyA7Vs9XoKG9rwUXfoVnYrO5CDP1LYsMUHp2LH3WQyw+FS/EJ4MZQYtQKHsf T7N5TLCQtNlEzCwwvMNwFODHlZij5Fa32HhkDlwF9Cp0njVekjBZOkMem0iFh70DmlNB agNpHNxMuuzgJZTcmm5mxWyYDLHFYdfIZdKazEz42Y0gHbK/vSPMI2X2hHx3W1QImpSy t69Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ptyzmEGfD8/blS2bQemYb8Zi8PZeWjE5gnrm1zv1D2Q=; b=DaLLaMh0FOVswFYhfRU4IAAfnqlkyNYMyfN43plV8EPvEJETwtEfUOh4cTxcEtC7+h +EM+K/+ASC3H54gjl+BN/5/GDjgdM8Ubj+DoZQFfdBo1z4wNksZTGLUjLKnhodBPlZEp DWhpvF4RC3LhPABKSuIGI7kZhQMQBeLC/wzen1DjeSx/eb8de4d1ucaGks7XhEvN0VsI 87PIYYBBVkEk47wACqIH1T88WNhjOOayOBvdoLaPaGgClltv+yV2EtPMSoB1D9fV0F3+ 86Y1Lu18zFwEtdWe3y9dhWIzN8or6U5YCSxzKsHbl6ct+0ymdf9oZIlGMTdaQwS2rVHW ayhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Pm7tDXn0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e91-v6si7494111plb.73.2018.04.06.00.02.41; Fri, 06 Apr 2018 00:02:56 -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=fail header.i=@gmail.com header.s=20161025 header.b=Pm7tDXn0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361AbeDFHBe (ORCPT + 99 others); Fri, 6 Apr 2018 03:01:34 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:33116 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbeDFHBd (ORCPT ); Fri, 6 Apr 2018 03:01:33 -0400 Received: by mail-qt0-f193.google.com with SMTP id d50so163843qtc.0 for ; Fri, 06 Apr 2018 00:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ptyzmEGfD8/blS2bQemYb8Zi8PZeWjE5gnrm1zv1D2Q=; b=Pm7tDXn0SRynSalOyhr90aLRgPEb18Eak7TYV7pomyqwTSqnSrwA5aD7izHi43zY/O zusFfZ1+He2/hJjZHxhpZn7l6tD4JUrXrb4uczL9lJNSfMtpDrnXf7v6LZwLzwQFM+SZ gLr4DCV8Exg8mkSkxaZ8uJNt9pL8lh2YPqxptHL1YKAvVBe9VoRBRKRTlpIMNVg3KRda rMV2XiyKoOXxCcaUhT9+8SlSmDwbayKp28upec/FC94tSvlXOdo1JRDOIdVOF6QALC0p gN+gf0ckpNihr5X8NOxsOL4Bhq21ubpyxGurN3xwvKOgSbVIVvjU6JgCCxFDlwX2pr9z O6vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ptyzmEGfD8/blS2bQemYb8Zi8PZeWjE5gnrm1zv1D2Q=; b=Zv4P2ClgpxVGoiZnaem9SLumWcwjytq+5zJiH/c+ehF+l++KSV3/YTuHjByfWyh/Lk Nf8apOp3MBw+g+yKC+b09P8mV+2SNCH4UTTu4TESZRrRUdkL/Q03fy4IDbgdNoq+e3SN r+uxq/mshoerpLAjj8zSZgOuOtQIHGQzwNlWSVsDSfcDTNloi9Sm4lfFXqsbHsxApLAt al1mLw8W7pS8BfUXWyyD/IY1i0ov07Qi1iKOVM8kwIQTeDKYxIfF8YnqvBKa1K59WU2P tUijiAGhV6C61+iM1C0wIk3zhofAG6q6RLPfkbTf+hrZzJmYOGjnY5oZX6I9cwbrcAA6 +tYg== X-Gm-Message-State: ALQs6tCZX5ZsVt8EgvRHKhvKouhWXtQrM0YjCjb8il+WU8Tjl5vV7Ft7 GS+eV9eW5PGhYPNwCL8GNKS95yFwWIrwcrxrOyQ= X-Received: by 10.200.18.71 with SMTP id g7mr36354644qtj.35.1522998092530; Fri, 06 Apr 2018 00:01:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.25 with HTTP; Fri, 6 Apr 2018 00:01:31 -0700 (PDT) In-Reply-To: <20180406063804.30510-1-tobias.regnery@gmail.com> References: <20180406063804.30510-1-tobias.regnery@gmail.com> From: Arnd Bergmann Date: Fri, 6 Apr 2018 09:01:31 +0200 X-Google-Sender-Auth: 3acGz5O296z2P1_C1mLnLgAibIY Message-ID: Subject: Re: [PATCH] pstore: fix crypto dependencies without compression To: Tobias Regnery Cc: Kees Cook , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;