Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1134436pxf; Fri, 2 Apr 2021 02:04:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9334kUI5MsilmlZDLglHe7A9nvbaQ90ZwQm6TXCzhuB8Sn2nJj927Lxx+VBvCv/jxbP1y X-Received: by 2002:a6b:500c:: with SMTP id e12mr9755095iob.190.1617354255978; Fri, 02 Apr 2021 02:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617354255; cv=none; d=google.com; s=arc-20160816; b=RY1br0SlV/0ssKct4dRyGrJ6u5yRlcT4ldQUWLQz/2RKI4i/ThyV9Lc4IJ2esU6O5g CwpptrH9RZIsKlAAWNGZXb+gFiYGRHnyxuxv3azICOh8rIKOY/46K8kFgp3QjgJnTTqd EF3uYXZ7a1Mb9AnmPn1vu4FFYH8npObXJrRjgF6Ee8dSpI6/5PMBvSPgrKx98wZzRMeD kc+Crt00NxAcFZRNcIjf5ZFzCodY4PRZW8UZ13y5MXfAjUJxup9pqrfj47dAoD09oJNp FbrZgPB+Wh9xodmsK2rWyoeBG389A2WjxCEWxfmtJf2kJB73CafOqrNB0w73ugIkwhwb Bzag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=6SWbGNWJVsaAIa5i7Z5rryV/jMFtw5EX92Ly3KBCCLE=; b=H5kwofxhI9mZ57gRxyYjEKf0U0kk0O2uU3SscppU+ZiNZ0pz1L7k/xVSVpJyvj5kYN 97AdryUGGtRS5mkFFLbtpGdtUSE7qUuecWZ/N8SMS98fSM6nml4JH47m3IUudQ8TJPGe YnwcwQv0vxlb5Tm84jGDqclK8RxVmPdOz2gQI6AimntyCE9Z3sQsq1FtMGEDLTyL9V0O HR8+EXJUhtCbcWkYIxOkGS8AavfAZoC6t+WpBntkFYt1gcmIINP60a8vbGmOP4aS7vzr FKMxigZPIFEBn3af20L9tWW9tAmW86SPlMJuSKmUB/ukBH0XSuERcEZelM4IdTOr4ax7 pb8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 h13si7342412iow.73.2021.04.02.02.03.51; Fri, 02 Apr 2021 02:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231287AbhDBJDs (ORCPT + 99 others); Fri, 2 Apr 2021 05:03:48 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:58910 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhDBJDs (ORCPT ); Fri, 2 Apr 2021 05:03:48 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1lSFiF-0002Hr-Gw; Fri, 02 Apr 2021 20:03:32 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 02 Apr 2021 20:03:31 +1100 Date: Fri, 2 Apr 2021 20:03:31 +1100 From: Herbert Xu To: Eric Biggers Cc: linux-crypto@vger.kernel.org, dan.carpenter@oracle.com, nhorman@tuxdriver.com, clabbe@baylibre.com, stable@vger.kernel.org Subject: Re: [PATCH] crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS Message-ID: <20210402090331.GA24545@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210322050748.265604-1-ebiggers@kernel.org> X-Newsgroups: apana.lists.os.linux.cryptoapi User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Eric Biggers wrote: > From: Eric Biggers > > crypto_stats_get() is a no-op when the kernel is compiled without > CONFIG_CRYPTO_STATS, so pairing it with crypto_alg_put() unconditionally > (as crypto_rng_reset() does) is wrong. > > Fix this by moving the call to crypto_stats_get() to just before the > actual algorithm operation which might need it. This makes it always > paired with crypto_stats_rng_seed(). > > Fixes: eed74b3eba9e ("crypto: rng - Fix a refcounting bug in crypto_rng_reset()") > Cc: stable@vger.kernel.org > Signed-off-by: Eric Biggers > --- > crypto/rng.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt