Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp135403lqh; Mon, 6 May 2024 13:52:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUwnsWFXG7fWtAKaGWuix5/Ht+7jqrYnGOk+4g+dQK+Jey9yChHVoVqjyiqxSJAZYgN3yoThWAyxtB1UQOMnU5E5FAI2cbgu7tX7BK0w== X-Google-Smtp-Source: AGHT+IGAraIy15rt22FGzeODRsa+SYZetfKUvARHfOcXZLTeRGYIdcqZm9I6xAwyOstL0xVyt8Hz X-Received: by 2002:a17:906:aad7:b0:a59:a8a4:a5aa with SMTP id kt23-20020a170906aad700b00a59a8a4a5aamr6603538ejb.44.1715028776103; Mon, 06 May 2024 13:52:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715028776; cv=pass; d=google.com; s=arc-20160816; b=Ip6qfNYOF22LGFBM9cN7OPW3/jug+J2T0S2B4NG4pL+JQimsALIehmgilb6ASsK12O +ixatuVbhYek3plhf1h2q+ALSt7IgCm7w+2roNoimdOdnhlDCwUxkc9db5CRBU4lnp0G Msbbn9XObZzP0OtxQ8fHU4o4EW1sQ1Vh607PwgGtRG2yYChHG2XUdVg+b0XHi6wFTI0+ jeK5agt4YT93rhkwDQ4u2iKMURjGAAN6tF7Ybyr7ghlBTcbXBg7YBFHbCWH+vLlaqGmK d+W1gHdzsg3Xt4ccWT/Q0BLyMbD+P9XfaI7SdUnIG9oNPKSIE7FvAeQIEoUi+ObIMQ8W 9wWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=uS6V9L4dP4QJ1TXfsHPrBG/DZ3hOVaztki0M7EWbY/Y=; fh=SDoiB0XDRZUdlAy0dUsS4SemjBt6sMwC6hyYZY+hWZQ=; b=NJk4AytvzXafN03HhaaLS7shQt7QM8S44BiXo1SINndJcZYIa74XLxKrGBeCO/lwv9 uI2glUoUgJLnwXjCJb7C8EpvMunL/yZN806tQ1aOs1kAT/I3LHIGyI4yXgKqFmc5Nvz+ aDBGqbwTKsm36E5SF+0cs4j0u7qKHZ2FqnCjHeGuKwDarcvaTQTBjuI9Cj3t+ziPlEzB hN5eFVADK2AAGB1u5anq9uZA20zN5k9PphCDQhdHnTHZt2VRtfE/KXoyrBKfCRYvB6OL MquPzK05V7oRGs9geGHbKimOWjNtmQlr3af3DJEuu4kQXZ8Pl4TnoKLcaWJl+T+3QlGN s2kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pdMA+0bX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gv21-20020a170906f11500b00a59b13a4f61si2690965ejb.444.2024.05.06.13.52.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 13:52:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pdMA+0bX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C745D1F223BD for ; Mon, 6 May 2024 20:52:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03FCA15ADBA; Mon, 6 May 2024 20:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pdMA+0bX" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4BA8EBB for ; Mon, 6 May 2024 20:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715028772; cv=none; b=E8Xq3lmlPVPiNs2WzKhyfZfQj3YjRiQdBuRXQ5nKiNNbC6PsBbBXECVkLT70t87kVQehnjlB618ghGMbiWAG7hPYDs0f5n/nXtn5Yw85Ae5lmg/6A28AZ7o3Lz9YbGqP7Nf6uphmdlxRXDK4sad8UJzzZCTO0si54vf8dqx8KaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715028772; c=relaxed/simple; bh=QISKV4ilz6H9BdF2IyTUJN5rFYUKwq8NKlXbRxDSSlo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=b7h7hCcHORkfSwiOZqmdSmnzbGc/VQbTip9ijExeFEDem3l+pWB1uLbJSlqH62o0jtEJJp0hf4pWawxoUWs0PE0aRxxR9D2fCYbhxh0opjsdW7oigzkjVvGfyocm6QAYd+bd/7dkXHfiU5SlbIKS56fyIBu2S3oE0XYYesOl12c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pdMA+0bX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CC61C116B1; Mon, 6 May 2024 20:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715028772; bh=QISKV4ilz6H9BdF2IyTUJN5rFYUKwq8NKlXbRxDSSlo=; h=From:To:Cc:Subject:Date:From; b=pdMA+0bXZoKG8KqOU1cKx87enjvhdneIBGuKi8mpaA0jYxPQL41pIXKsMaU41DaSs LhEOCsb1FZD6/ylU3i/d9sfY5hS9eVFSnx6Y/KyK01FwEGxSNSnDEiVRMbjL2ZgIjD 6Hv943qguvnEqNH+NGYJ0zgiFiuyijt8kyUsPKSNfsvjOiwlWzjv/vKgyQ/+ur6RsI i71BFVbxfCgM/xCpi21u5zYHzyo/Uq2+PcLwp0FCP2iIq2Kfnr0e7oggB29OW7q4Im SaXzz7t1jS5USaVwunknPPMuU93oiXr7e57exxm4bMVLNqjhTuWCvft2bG70cp2Sv6 P6Vb9cU3aUJCQ== From: cel@kernel.org To: Cc: Chuck Lever , Dan Carpenter Subject: [PATCH] SUNRPC: Fix gss_free_in_token_pages() Date: Mon, 6 May 2024 16:52:45 -0400 Message-ID: <20240506205245.4455-1-cel@kernel.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Commit 5866efa8cbfb ("SUNRPC: Fix svcauth_gss_proxy_init()") from Oct 24, 2019 (linux-next), leads to the following Smatch static checker warning: net/sunrpc/auth_gss/svcauth_gss.c:1039 gss_free_in_token_pages() warn: iterator 'i' not incremented net/sunrpc/auth_gss/svcauth_gss.c 1034 static void gss_free_in_token_pages(struct gssp_in_token *in_token) 1035 { 1036 u32 inlen; 1037 int i; 1038 --> 1039 i = 0; 1040 inlen = in_token->page_len; 1041 while (inlen) { 1042 if (in_token->pages[i]) 1043 put_page(in_token->pages[i]); ^ This puts page zero over and over. 1044 inlen -= inlen > PAGE_SIZE ? PAGE_SIZE : inlen; 1045 } 1046 1047 kfree(in_token->pages); 1048 in_token->pages = NULL; 1049 } Reported-by: Dan Carpenter Fixes: 5866efa8cbfb ("SUNRPC: Fix svcauth_gss_proxy_init()") Signed-off-by: Chuck Lever --- net/sunrpc/auth_gss/svcauth_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 24de94184700..bdd8273d74d3 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1040,7 +1040,7 @@ static void gss_free_in_token_pages(struct gssp_in_token *in_token) inlen = in_token->page_len; while (inlen) { if (in_token->pages[i]) - put_page(in_token->pages[i]); + put_page(in_token->pages[i++]); inlen -= inlen > PAGE_SIZE ? PAGE_SIZE : inlen; } base-commit: 939cb14d51a150e3c12ef7a8ce0ba04ce6131bd2 -- 2.44.0