{"id":"CVE-2022-50135","state":"PUBLISHED","title":"RDMA/rxe: Fix BUG: KASAN: null-ptr-deref in rxe_qp_do_cleanup","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/rxe: Fix BUG: KASAN: null-ptr-deref in rxe_qp_do_cleanup\n\nThe function rxe_create_qp calls rxe_qp_from_init. If some error\noccurs, the error handler of function rxe_qp_from_init will set\nboth scq and rcq to NULL.\n\nThen rxe_create_qp calls rxe_put to handle qp. In the end,\nrxe_qp_do_cleanup is called by rxe_put. rxe_qp_do_cleanup directly\naccesses scq and rcq before checking them. This will cause\nnull-ptr-deref error.\n\nThe call graph is as below:\n\nrxe_create_qp {\n  ...\n  rxe_qp_from_init {\n    ...\n  err1:\n    ...\n    qp->rcq = NULL;  <---rcq is set to NULL\n    qp->scq = NULL;  <---scq is set to NULL\n    ...\n  }\n\nqp_init:\n  rxe_put{\n    ...\n    rxe_qp_do_cleanup {\n      ...\n      atomic_dec(&qp->scq->num_wq); <--- scq is accessed\n      ...\n      atomic_dec(&qp->rcq->num_wq); <--- rcq is accessed\n    }\n}","publishedAt":"2025-06-18T11:02:59.440Z","updatedAt":"2026-05-11T19:13:30.141Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4703b4f0d94a5f887297713a2f6c2916a1ef08fd","status":"affected","lessThan":"8598b9d0a364c1663c96fc0fab9df0d36c809aea","versionType":"git"},{"version":"4703b4f0d94a5f887297713a2f6c2916a1ef08fd","status":"affected","lessThan":"37da51efe6eaa0560f46803c8c436a48a2084da7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/sw/rxe/rxe_qp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.2","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":["drivers/infiniband/sw/rxe/rxe_qp.c"]}],"references":["https://git.kernel.org/stable/c/8598b9d0a364c1663c96fc0fab9df0d36c809aea","https://git.kernel.org/stable/c/37da51efe6eaa0560f46803c8c436a48a2084da7"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50135.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50135","state":"PUBLISHED","datePublished":"2025-06-18T11:02:59.440Z","dateUpdated":"2026-05-11T19:13:30.141Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-06-18T10:57:27.421Z"},"containers":{"cna":{"title":"RDMA/rxe: Fix BUG: KASAN: null-ptr-deref in rxe_qp_do_cleanup","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/rxe: Fix BUG: KASAN: null-ptr-deref in rxe_qp_do_cleanup\n\nThe function rxe_create_qp calls rxe_qp_from_init. If some error\noccurs, the error handler of function rxe_qp_from_init will set\nboth scq and rcq to NULL.\n\nThen rxe_create_qp calls rxe_put to handle qp. In the end,\nrxe_qp_do_cleanup is called by rxe_put. rxe_qp_do_cleanup directly\naccesses scq and rcq before checking them. This will cause\nnull-ptr-deref error.\n\nThe call graph is as below:\n\nrxe_create_qp {\n  ...\n  rxe_qp_from_init {\n    ...\n  err1:\n    ...\n    qp->rcq = NULL;  <---rcq is set to NULL\n    qp->scq = NULL;  <---scq is set to NULL\n    ...\n  }\n\nqp_init:\n  rxe_put{\n    ...\n    rxe_qp_do_cleanup {\n      ...\n      atomic_dec(&qp->scq->num_wq); <--- scq is accessed\n      ...\n      atomic_dec(&qp->rcq->num_wq); <--- rcq is accessed\n    }\n}"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4703b4f0d94a5f887297713a2f6c2916a1ef08fd","status":"affected","lessThan":"8598b9d0a364c1663c96fc0fab9df0d36c809aea","versionType":"git"},{"version":"4703b4f0d94a5f887297713a2f6c2916a1ef08fd","status":"affected","lessThan":"37da51efe6eaa0560f46803c8c436a48a2084da7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/sw/rxe/rxe_qp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.2","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":["drivers/infiniband/sw/rxe/rxe_qp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/8598b9d0a364c1663c96fc0fab9df0d36c809aea"},{"url":"https://git.kernel.org/stable/c/37da51efe6eaa0560f46803c8c436a48a2084da7"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:13:30.141Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"5.19.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}