CVE-2026-45870

Source
https://cve.org/CVERecord?id=CVE-2026-45870
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-45870.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2026-45870
Downstream
Related
Published
2026-05-27T12:15:50.199Z
Modified
2026-07-02T09:29:13.263547420Z
Summary
SUNRPC: auth_gss: fix memory leaks in XDR decoding error paths
Details

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

SUNRPC: auth_gss: fix memory leaks in XDR decoding error paths

The gssxdecctx(), gssxdecstatus(), and gssxdecname() functions allocate memory via gssxdecbuffer(), which calls kmemdup(). When a subsequent decode operation fails, these functions return immediately without freeing previously allocated buffers, causing memory leaks.

The leak in gssxdecctx() is particularly relevant because the caller (gsspacceptseccontextupcall) initializes several buffer length fields to non-zero values, resulting in memory allocation:

struct gssx_ctx rctxh = {
    .exported_context_token.len = GSSX_max_output_handle_sz,
    .mech.len = GSS_OID_MAX_LEN,
    .src_name.display_name.len = GSSX_max_princ_sz,
    .targ_name.display_name.len = GSSX_max_princ_sz
};

If, for example, gssxdecname() succeeds for srcname but fails for targname, the memory allocated for exportedcontexttoken, mech, and srcname.displayname remains unreferenced and cannot be reclaimed.

Add error handling with goto-based cleanup to free any previously allocated buffers before returning an error.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45870.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1d658336b05f8697d6445834f8867f8ad5e4f735
Fixed
c81431b1b9fbd21e9a5a9211b5517b7295d18e6a
Fixed
caf7eff432e91a9eba1c79fa545c2f54be15d62b
Fixed
64303b92d94c0c7845a273acd8d84b796d6f1db7
Fixed
df10f23defff22c8d55fe6db74f6e4ce927145bf
Fixed
b4af3806846778799cd4ab0766dc18341e777264
Fixed
d79b9097a6a2b91471b40755f1225364be5d85ff
Fixed
3b56eb90feb8a3709417f5624f3871847d42bcb1
Fixed
3e6397b056335cc56ef0e9da36c95946a19f5118

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-45870.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.10.0
Fixed
5.10.252
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.202
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.165
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.128
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.75
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.14
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
6.19.4

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-45870.json"