Skip to content
Heist/ feed
Back to feed
UnratedFix available

net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change() The issue happens on some error handling paths. When the function fails to grab the object `xprt`, it simply returns 0, forgetting to decrease the reference count of another object `xps`, which is increased by rpc_sysfs_xprt_kobj_get_xprt_switch(), causing refcount leaks. Also, the function forgets to check whether `xps` is valid before using it, which may result in NULL-dereferencing issues. Fix it by adding proper error handling code when either `xprt` or `xps` is NULL.

Products
Kernel
Affected versions
Not specified
Fixed versions
5.15.63, 5.19.4
CVEs
CVE-2022-50046
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 18:25 UTC · Revision 1

Source evidence

net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()

core-osv · Original source

Published 18 Jun 2025, 11:01 UTC

In the Linux kernel, the following vulnerability has been resolved: net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change() The issue happens on some error handling paths. When the function fails to grab the object `xprt`, it simply returns 0, forgetting to decrease the reference count of another object `xps`, which is increased by rpc_sysfs_xprt_kobj_get_xprt_switch(), causing refcount leaks. Also, the function forgets to check whether `xps` is valid before using it, which may result in NULL-dereferencing issues. Fix it by adding proper error handling code when either `xprt` or `xps` is NULL.

osv:CVE-2022-50046

Kernel

Fixed versions: 5.15.63, 5.19.4

Complete source record
{
  "id": "ea6ec4eb8861eacbb7601703ee03188aa94d5e3dc9284e2592c9bd9f78ae7a7b",
  "url": "https://osv.dev/vulnerability/CVE-2022-50046",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change() The issue happens on some error handling paths. When the function fails to grab the object `xprt`, it simply returns 0, forgetting to decrease the reference count of another object `xps`, which is increased by rpc_sysfs_xprt_kobj_get_xprt_switch(), causing refcount leaks. Also, the function forgets to check whether `xps` is valid before using it, which may result in NULL-dereferencing issues. Fix it by adding proper error handling code when either `xprt` or `xps` is NULL.",
    "evidence": "osv:CVE-2022-50046",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.15.63",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.19.4",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2022-50046",
      "aliases": [
        "CVE-2022-50046"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b"
                },
                {
                  "fixed": "c0434f0e058648649250b8ed6078b66d773de723"
                },
                {
                  "fixed": "76fbeb1662b1c56514325118a07fba74dc4c79fe"
                },
                {
                  "fixed": "bfc48f1b0505ffcb03a6d749139b7577d6b81ae0"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50046.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.14.0"
                },
                {
                  "fixed": "5.15.63"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "5.19.4"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50046.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:31.466811477Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/76fbeb1662b1c56514325118a07fba74dc4c79fe",
        "https://git.kernel.org/stable/c/bfc48f1b0505ffcb03a6d749139b7577d6b81ae0",
        "https://git.kernel.org/stable/c/c0434f0e058648649250b8ed6078b66d773de723",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50046.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-50046",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50046.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-50046",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 498384,
  "published_at": "2025-06-18T11:01:47.155+00:00"
}