Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3396742rwa; Tue, 23 Aug 2022 04:12:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4c8pNV3r3lq4u3PP7OIFAqiAEnGzR9Dz2KpK2cZ8ykRrqR8x07aGV0gttf7HybPdLSTV7z X-Received: by 2002:a17:907:e89:b0:73d:a99a:7943 with SMTP id ho9-20020a1709070e8900b0073da99a7943mr342351ejc.682.1661253171237; Tue, 23 Aug 2022 04:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253171; cv=none; d=google.com; s=arc-20160816; b=n4ytxL+cKugA5PDYGYSyXNaYbzwn95fV7FYrXQytS+Kz1WwZfHmB5fKEO3lzZEx0KS 452JPx+6oWS7JmWj37CXBE2FfQcn1kJb0po8C8v4iSGNNvn9dMlWdc2lsO/idwuWo65U 9MehVzHAnM8LYuQAZsuBhOKJE66Q9n9cO2e2EJVPkNbwLVAY3q6kY4MojlCg8Z5vxerJ BtfFK/M58x3ZX1JvuH4dIyo4OpvkOn12Y7PqSmzOzblR41ve4WtCnFra09fgVKvUnTcY jiA+Brcry1xoN5muHnL/zpxXZS6p/rdlmcZiwi/Oy9jUzhI1APujl3ELx9/OaHL3P8S6 RjCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pRGgNV02P+4VYVPEV7j9/F/SufEi/u4VixVM9DC1qyE=; b=GpK+Hna2CzJDMRXsKvQdA4PuUNN9PKzanDtIUL3Nle5dBkjNp99DbL+L0XQsieoX8y l8DC2pVeTAFWLwIEeETdj18T5ELOHEnYwFtWSBnn8ZE+8ql1jHq1D6KuIyYzkCGchUZ9 hrCGRhrAo3XPK9I6B7HNVDbPJcoN15ghbpDKgylGxm+OXU5YBLOnkBTY5rT4vTZ4Nib3 u3BJg5giSgBofTnEwCZ/E/Hk8YJgJt0zPuzW9S3zFne2XKlYWI9arXjkqkJ9pLI63mxY z9dKjIrQBokzqLwwi111/0Namf2n9r/vNq5NpfkffDFmtx9DeGu8k8bxcK1pjMv3at68 EBCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nY/7Ueak"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a056402274900b00446b9916bcesi2353322edd.13.2022.08.23.04.12.25; Tue, 23 Aug 2022 04:12:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nY/7Ueak"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244664AbiHWJ6N (ORCPT + 99 others); Tue, 23 Aug 2022 05:58:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243947AbiHWJxP (ORCPT ); Tue, 23 Aug 2022 05:53:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7F2B9F773; Tue, 23 Aug 2022 01:46:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A852B81C39; Tue, 23 Aug 2022 08:46:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68E9AC433D6; Tue, 23 Aug 2022 08:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244378; bh=qbghJcHm0gVRjNPJv+owcXxInm53demoP6ZbyBNgN08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nY/7UeakdRWQrSd263jPpSw20inCKdIp3NDE2PrlzvXBeiLlykeeIyGS7cauhUnYh kZOkcD9zWzVrW8YbTtrYdQAq/BMvVgoazArnrrALQa+fsUFdE/s66Bx3eEeiHbCydX mI4BVN3tQrPKe+7ZUy5BRKa8hv15/3st418TJT+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Aloni , Trond Myklebust Subject: [PATCH 5.15 053/244] sunrpc: fix expiry of auth creds Date: Tue, 23 Aug 2022 10:23:32 +0200 Message-Id: <20220823080100.837107068@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Aloni commit f1bafa7375c01ff71fb7cb97c06caadfcfe815f3 upstream. Before this commit, with a large enough LRU of expired items (100), the loop skipped all the expired items and was entirely ineffectual in trimming the LRU list. Fixes: 95cd623250ad ('SUNRPC: Clean up the AUTH cache code') Signed-off-by: Dan Aloni Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -445,7 +445,7 @@ rpcauth_prune_expired(struct list_head * * Enforce a 60 second garbage collection moratorium * Note that the cred_unused list must be time-ordered. */ - if (!time_in_range(cred->cr_expire, expired, jiffies)) + if (time_in_range(cred->cr_expire, expired, jiffies)) continue; if (!rpcauth_unhash_cred(cred)) continue;