{"id":"CVE-2022-50046","state":"PUBLISHED","title":"net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()\n\nThe issue happens on some error handling paths. When the function\nfails to grab the object `xprt`, it simply returns 0, forgetting to\ndecrease the reference count of another object `xps`, which is\nincreased by rpc_sysfs_xprt_kobj_get_xprt_switch(), causing refcount\nleaks. Also, the function forgets to check whether `xps` is valid\nbefore using it, which may result in NULL-dereferencing issues.\n\nFix it by adding proper error handling code when either `xprt` or\n`xps` is NULL.","publishedAt":"2025-06-18T11:01:47.155Z","updatedAt":"2026-05-11T19:11:48.153Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b","status":"affected","lessThan":"c0434f0e058648649250b8ed6078b66d773de723","versionType":"git"},{"version":"5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b","status":"affected","lessThan":"76fbeb1662b1c56514325118a07fba74dc4c79fe","versionType":"git"},{"version":"5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b","status":"affected","lessThan":"bfc48f1b0505ffcb03a6d749139b7577d6b81ae0","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sunrpc/sysfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.14","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.14","versionType":"semver"},{"version":"5.15.63","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.19.4","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sunrpc/sysfs.c"]}],"references":["https://git.kernel.org/stable/c/c0434f0e058648649250b8ed6078b66d773de723","https://git.kernel.org/stable/c/76fbeb1662b1c56514325118a07fba74dc4c79fe","https://git.kernel.org/stable/c/bfc48f1b0505ffcb03a6d749139b7577d6b81ae0"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50046.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50046","state":"PUBLISHED","datePublished":"2025-06-18T11:01:47.155Z","dateUpdated":"2026-05-11T19:11:48.153Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-06-18T10:57:27.401Z"},"containers":{"cna":{"title":"net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change()\n\nThe issue happens on some error handling paths. When the function\nfails to grab the object `xprt`, it simply returns 0, forgetting to\ndecrease the reference count of another object `xps`, which is\nincreased by rpc_sysfs_xprt_kobj_get_xprt_switch(), causing refcount\nleaks. Also, the function forgets to check whether `xps` is valid\nbefore using it, which may result in NULL-dereferencing issues.\n\nFix it by adding proper error handling code when either `xprt` or\n`xps` is NULL."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b","status":"affected","lessThan":"c0434f0e058648649250b8ed6078b66d773de723","versionType":"git"},{"version":"5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b","status":"affected","lessThan":"76fbeb1662b1c56514325118a07fba74dc4c79fe","versionType":"git"},{"version":"5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b","status":"affected","lessThan":"bfc48f1b0505ffcb03a6d749139b7577d6b81ae0","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sunrpc/sysfs.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.14","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.14","versionType":"semver"},{"version":"5.15.63","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.19.4","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/sunrpc/sysfs.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/c0434f0e058648649250b8ed6078b66d773de723"},{"url":"https://git.kernel.org/stable/c/76fbeb1662b1c56514325118a07fba74dc4c79fe"},{"url":"https://git.kernel.org/stable/c/bfc48f1b0505ffcb03a6d749139b7577d6b81ae0"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:11:48.153Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.14","versionEndExcluding":"5.15.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.14","versionEndExcluding":"5.19.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.14","versionEndExcluding":"6.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}