VYPR
Unrated severityNVD Advisory· Published May 27, 2026· Updated May 27, 2026

CVE-2026-45964

CVE-2026-45964

Description

In the Linux kernel, the following vulnerability has been resolved:

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

Commit 5940d1cf9f42 ("SUNRPC: Rebalance a kref in auth_gss.c") added a kref_get(&gss_auth->kref) call to balance the gss_put_auth() done in gss_release_msg(), but forgot to add a corresponding kref_put() on the error path when kstrdup_const() fails.

If service_name is non-NULL and kstrdup_const() fails, the function jumps to err_put_pipe_version which calls put_pipe_version() and kfree(gss_msg), but never releases the gss_auth reference. This leads to a kref leak where the gss_auth structure is never freed.

Add a forward declaration for gss_free_callback() and call kref_put() in the err_put_pipe_version error path to properly release the reference taken earlier.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A kref leak in the Linux kernel's SUNRPC gss_alloc_msg error path can lead to memory leaks and potential resource exhaustion.

Vulnerability

In the Linux kernel's SUNRPC module, the function gss_alloc_msg has a kref leak in its error path. When kstrdup_const() fails and service_name is non-NULL, the error path at err_put_pipe_version calls put_pipe_version() and kfree(gss_msg) but does not release the gss_auth reference obtained earlier via kref_get(). This issue was introduced by commit 5940d1cf9f42 ("SUNRPC: Rebalance a kref in auth_gss.c"). The leak affects kernels that include that commit and lack the subsequent fix.

Exploitation

An attacker needs to trigger a failure in kstrdup_const() within gss_alloc_msg(). This could be achieved by exhausting memory or causing a transient allocation failure. No special privileges are required beyond the ability to initiate GSS-authenticated RPC operations (e.g., NFS mounts). The attacker repeatedly triggers the error path to accumulate unreleased references.

Impact

Each invocation of the error path leaks one reference count on the gss_auth structure. Over time, repeated exploitation can cause resource exhaustion (memory leak) as gss_auth objects are never freed. This can lead to system instability or denial of service. There is no direct privilege escalation or data corruption.

Mitigation

The fix adds a kref_put() call in the err_put_pipe_version error path via commits [1] and [2]. Users should update to a kernel version that includes these commits. As of the publication date, stable kernel updates containing the fix are available. No workaround is known; applying the patch is recommended.

AI Insight generated on May 27, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

1

Patches

16
c20f92521424

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitDaniel HodgesFixed in 6.18.14via kernel-cna
2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
3b2b6c42070c

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitDaniel HodgesFixed in 5.10.252via kernel-cna
2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 7ce4a6b7cfae62..5f6d67023a1b08 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -534,6 +536,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 7ce4a6b7cfae62..5f6d67023a1b08 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -534,6 +536,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
b559be2ec6cd

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitDaniel HodgesFixed in 5.15.202via kernel-cna
2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 7ce4a6b7cfae62..5f6d67023a1b08 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -534,6 +536,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 7ce4a6b7cfae62..5f6d67023a1b08 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -534,6 +536,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
a1bc9561b617

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitDaniel HodgesFixed in 6.1.165via kernel-cna
2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 3ef511d7af1905..85e6f6b3c6d8e0 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -535,6 +537,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 3ef511d7af1905..85e6f6b3c6d8e0 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -535,6 +537,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
655c9ba9915f

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitDaniel HodgesFixed in 6.6.128via kernel-cna
2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 00753bc5f1b147..13a948e2f83d4f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 00753bc5f1b147..13a948e2f83d4f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
e464e26b2457

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.gitDaniel HodgesFixed in 6.12.75via kernel-cna
2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 369310909fc985..785d53a6124265 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 369310909fc985..785d53a6124265 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
a2d4e9a76de0

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
dd2fdc350459

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
e464e26b2457

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 369310909fc985..785d53a6124265 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 369310909fc985..785d53a6124265 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
3b2b6c42070c

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

1 file changed · +3 1
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 7ce4a6b7cfae62..5f6d67023a1b08 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -534,6 +536,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
655c9ba9915f

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

1 file changed · +3 1
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 00753bc5f1b147..13a948e2f83d4f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
a1bc9561b617

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

1 file changed · +3 1
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 3ef511d7af1905..85e6f6b3c6d8e0 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -535,6 +537,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
a2d4e9a76de0

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

1 file changed · +3 1
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
b559be2ec6cd

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 7ce4a6b7cfae62..5f6d67023a1b08 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -534,6 +536,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 7ce4a6b7cfae62..5f6d67023a1b08 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -534,6 +536,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
c20f92521424

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
dd2fdc350459

SUNRPC: fix gss_auth kref leak in gss_alloc_msg error path

2 files changed · +6 2
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    
  • net/sunrpc/auth_gss/auth_gss.c+3 1 modified
    diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
    index 5c095cb8cb201e..bb3c3db2713b1f 100644
    --- a/net/sunrpc/auth_gss/auth_gss.c
    +++ b/net/sunrpc/auth_gss/auth_gss.c
    @@ -39,6 +39,8 @@ static const struct rpc_authops authgss_ops;
     static const struct rpc_credops gss_credops;
     static const struct rpc_credops gss_nullops;
     
    +static void gss_free_callback(struct kref *kref);
    +
     #define GSS_RETRY_EXPIRED 5
     static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
     
    @@ -551,6 +553,7 @@ gss_alloc_msg(struct gss_auth *gss_auth,
     	}
     	return gss_msg;
     err_put_pipe_version:
    +	kref_put(&gss_auth->kref, gss_free_callback);
     	put_pipe_version(gss_auth->net);
     err_free_msg:
     	kfree(gss_msg);
    -- 
    cgit 1.3-korg
    
    
    

Vulnerability mechanics

Root cause

"Missing kref_put() call in the gss_alloc_msg error path when kstrdup_const() fails, causing a kref leak on the gss_auth structure."

Attack vector

An attacker who can trigger a memory allocation failure for kstrdup_const() inside gss_alloc_msg() — for example by exhausting system memory — will cause the function to jump to the err_put_pipe_version label. That error path calls put_pipe_version() and kfree(gss_msg) but never releases the kref reference that was taken earlier via kref_get(&gss_auth->kref). This results in a kref leak where the gss_auth structure is never freed, leading to a memory leak. The precondition is that service_name is non-NULL and kstrdup_const() fails [patch_id=2660935].

Affected code

The vulnerable function is gss_alloc_msg() in net/sunrpc/auth_gss/auth_gss.c. The error label err_put_pipe_version previously lacked a kref_put() call to balance the kref_get(&gss_auth->kref) that was added by commit 5940d1cf9f42 [patch_id=2660935].

What the fix does

The patch adds a forward declaration for gss_free_callback() and inserts a kref_put(&gss_auth->kref, gss_free_callback) call at the err_put_pipe_version label in net/sunrpc/auth_gss/auth_gss.c [patch_id=2660935]. This ensures that when the error path is taken after a kref_get() was already performed, the reference is properly released, preventing the gss_auth structure from leaking. The fix mirrors the balancing logic that was already present in the success path via gss_release_msg().

Preconditions

  • inputservice_name must be non-NULL
  • inputkstrdup_const() must fail (e.g., memory allocation failure)

Generated on May 27, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

8

News mentions

0

No linked articles in our index yet.