Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp932506rdg; Fri, 11 Aug 2023 04:55:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7Pe8zvrwZWe3/XF8bx8N3//lLN6jbQU4ncDSTGxaXVctm5eM/fVYZKDO96BjAS1cFN9L+ X-Received: by 2002:a05:6a21:66c6:b0:133:bf9a:dd16 with SMTP id ze6-20020a056a2166c600b00133bf9add16mr1738982pzb.35.1691754940860; Fri, 11 Aug 2023 04:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691754940; cv=none; d=google.com; s=arc-20160816; b=vMeUq/x2J1Wzsh7Lj4vsuyouRnwWkDyWSFues/c7oHMe55FEcWzqIRRxWnBvpFHwHi HK3ftbWv1IqXXtDVCENsxWwBPP4Ml9xWaHca3k0P5SHe4KyZ2OkwoXP0SmXNGHVeKwsr 6gGTZ2er5uifNJ77GElaW94KGDQ6zlbeQBr0C0EzEoNpWGNZPQmk4Vne3cTBpxaZjNhQ QzH/8sNa7SN6kl4m5dNhZZijYy6slXmxc6iyunLan+GBN3KJoAKvMXEfLaRoGg8e9B/U xRhOdUvwEl3BPBq4yeyQii3GXqXHrKc9k5BZc4bU8h3jKGF8g3xuTBiegG5PuPdzvBtY Fjgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=i/b3SJAAAEtxV9cAfPMgYz3qGKKOZBu//Kq76D4ygRM=; fh=NuwrxDw/Vl5VusLUSDer/nEi5iS/iUQ9L881E6Z7qnE=; b=u62JK+qHM+0WKSgL5Z5l5s/JrT9l9i/MlWyajIH9UWvmo5x8GeT+8kkJu5x44VUg7G IzaUZL8YCSAsOIMBWfZYtA+XZ58VengppagE099lvpDh5Ozgah1+dQfNnOE17a1dS+Ng ZQP03jPRInxCEpNRRENx8vRodwOwoDvD1bowok2IXec3B0TE1fat4Mb86eU5ypoHTItd NhGpbEAHSVTzpQJpHlTOHPUY+Kbp2PjcR9AiqOROKstbBKvDHSJkols3nMwXhtUe90y+ VfU35DpZbnoVGOqL3GN6M0p7BVsQD+vQhrd/IOiVY1QBWHb2cG3D3/bGrb/iLa6npqmp F1Wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a63cc4f000000b0053424040bb7si3349490pgi.298.2023.08.11.04.55.27; Fri, 11 Aug 2023 04:55:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236477AbjHKL33 (ORCPT + 99 others); Fri, 11 Aug 2023 07:29:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236461AbjHKL32 (ORCPT ); Fri, 11 Aug 2023 07:29:28 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31AEFE62; Fri, 11 Aug 2023 04:29:28 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qUQKU-00248s-Uf; Fri, 11 Aug 2023 19:29:19 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 11 Aug 2023 19:29:19 +0800 Date: Fri, 11 Aug 2023 19:29:19 +0800 From: Herbert Xu To: Frederick Lawler Cc: davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, stable@vger.kernel.org Subject: Re: [PATCH] crypto: af_alg - Decrement struct key.usage in alg_set_by_key_serial() Message-ID: References: <20230801135709.2218855-1-fred@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801135709.2218855-1-fred@cloudflare.com> X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,HELO_DYNAMIC_IPADDR2, PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TVD_RCVD_IP, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Aug 01, 2023 at 08:57:09AM -0500, Frederick Lawler wrote: > Calls to lookup_user_key() require a corresponding key_put() to > decrement the usage counter. Once it reaches zero, we schedule key GC. > Therefore decrement struct key.usage in alg_set_by_key_serial(). > > Fixes: 7984ceb134bf ("crypto: af_alg - Support symmetric encryption via keyring keys") > Cc: > Signed-off-by: Frederick Lawler > --- > This is rebased ontop of Linus's 6.5-rc1. Original patch was introduced in 6.2. > --- > crypto/af_alg.c | 3 +++ > 1 file changed, 3 insertions(+) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt