From: "Chuck Lever" <cel@kernel.org>
To: "Haoxiang Li" <lihaoxiang@isrc.iscas.ac.cn>,
"Trond Myklebust" <trondmy@kernel.org>,
"Anna Schumaker" <anna@kernel.org>,
davem@davemloft.net, edumazet@google.com,
"Jakub Kicinski" <kuba@kernel.org>,
pabeni@redhat.com, "Simon Horman" <horms@kernel.org>,
llfamsec@gmail.com, simo@redhat.com, bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] sunrpc: fix a resource leak in gss_proxy_save_rsc()
Date: Mon, 26 Jan 2026 11:43:18 -0500 [thread overview]
Message-ID: <9b028652-eb5b-4faf-bf9c-6d64f0ed7a9f@app.fastmail.com> (raw)
In-Reply-To: <20260126021047.2478741-1-lihaoxiang@isrc.iscas.ac.cn>
On Sun, Jan 25, 2026, at 9:10 PM, Haoxiang Li wrote:
> In gss_proxy_save_rsc(), if gss_import_sec_context() fails,
> call gss_mech_put() to release the reources acquired by
> gss_mech_get_by_OID().
>
> Fixes: 030d794bf498 ("SUNRPC: Use gssproxy upcall for server RPCGSS
> authentication.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
> net/sunrpc/auth_gss/svcauth_gss.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/auth_gss/svcauth_gss.c
> b/net/sunrpc/auth_gss/svcauth_gss.c
> index a8ec30759a18..cdae1f23adfc 100644
> --- a/net/sunrpc/auth_gss/svcauth_gss.c
> +++ b/net/sunrpc/auth_gss/svcauth_gss.c
> @@ -1268,8 +1268,10 @@ static int gss_proxy_save_rsc(struct
> cache_detail *cd,
> ud->out_handle.len,
> gm, &rsci.mechctx,
> &expiry, GFP_KERNEL);
> - if (status)
> + if (status) {
> + gss_mech_put(gm);
> goto out;
> + }
Is the reference already released via free_svc_cred() ? This
change might introduce a double-free bug.
>
> getboottime64(&boot);
> expiry -= boot.tv_sec;
> --
> 2.25.1
--
Chuck Lever
prev parent reply other threads:[~2026-01-26 16:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 2:10 [PATCH] sunrpc: fix a resource leak in gss_proxy_save_rsc() Haoxiang Li
2026-01-26 16:43 ` Chuck Lever [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9b028652-eb5b-4faf-bf9c-6d64f0ed7a9f@app.fastmail.com \
--to=cel@kernel.org \
--cc=anna@kernel.org \
--cc=bfields@fieldses.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=lihaoxiang@isrc.iscas.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=llfamsec@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=simo@redhat.com \
--cc=stable@vger.kernel.org \
--cc=trondmy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox