{"id":"CVE-2026-98360","revision":"b10fe3996c2140b8827ff517f674d60d","records":[{"revision":"b10fe3996c2140b8827ff517f674d60d","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-98360","aliases":[],"title":"RDMA/rxe: insert mcg into mcg_tree only after rxe_mcast_add() succeeds","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/rxe: insert mcg into mcg_tree only after rxe_mcast_add() succeeds\n\nrxe_get_mcg() publishes a newly allocated multicast group in\nrxe->mcg_tree before programming the backing Ethernet multicast address\nwith rxe_mcast_add(), which runs outside mcg_lock. A local userspace\nRDMA client reaches this path with ATTACH_MCAST on a UD QP; if\nrxe_mcast_add() then returns an error (for example -ENODEV when the\nbacking netdev has been removed, or a propagated dev_mc_add() error),\nthe unwind frees the published group without removing it from the tree.\nA later lookup of the same MGID dereferences the freed struct rxe_mcg\nfrom __rxe_lookup_mcg().\n\nFix this by keeping the new mcg private until rxe_mcast_add() succeeds.\nSplit the tree publication into __rxe_publish_mcg(), call rxe_mcast_add()\nbefore taking the tree reference, and free the still-private mcg on\nfailure. Because the group is never visible in mcg_tree until the\nmulticast address is programmed, no concurrent caller can look it up or\nattach a QP to a group that is about to be torn down, so the error path\nneeds no conditional unwind. If another caller publishes the same MGID\nwhile the address is being programmed, the post-add re-check under\nmcg_lock finds the winner; this caller then drops its private object and\nbalances its own rxe_mcast_add() with rxe_mcast_del() before returning\nthe winner.\n\nReproduced by forcing the rxe_mcast_add() error return under KASAN:\nwithout the change the next attach to the same MGID reports a\nslab-use-after-free in __rxe_lookup_mcg(); with it the forced failure\nreturns cleanly. A no-injection attach/detach regression, including a\ntwo-QP shared join/leave and re-attach, stays KASAN- and leak-clean.","state":0,"publishedAt":"2026-10-06T08:46:46.743+00:00","modifiedAt":"2026-10-19T09:18:11.284+00:00","affected":[{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"drivers/infiniband/sw/rxe/rxe_mcast.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"a926a903b7dc39a8a949150258c09290998dd812\",\n                            \"lessThan\": \"ddb43ac0926d4a931bc9b7744b93627f627457e5\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"a926a903b7dc39a8a949150258c09290998dd812\",\n                            \"lessThan\": \"c79a789aa15180a1543b5db49c343d12e3ec214d\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"a926a903b7dc39a8a949150258c09290998dd812\",\n                            \"lessThan\": \"faae1fb4ccf8205806a8802c008798dabeb0205b\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"a926a903b7dc39a8a949150258c09290998dd812\",\n                            \"lessThan\": \"02c0a2fa69c16248a7432af8a6d64ab2a73a5283\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"a926a903b7dc39a8a949150258c09290998dd812\",\n                            \"lessThan\": \"d4fc4e37f8a143b0fe83b42c8fb48cf542154fee\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"a926a903b7dc39a8a949150258c09290998dd812\",\n                            \"lessThan\": \"1caceeb2d74bbe88223aea55eb8626b4c5f076fd\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"affected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"drivers/infiniband/sw/rxe/rxe_mcast.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"5.18\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"5.18\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.1.189\",\n                            \"lessThanOrEqual\": \"6.1.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.6.158\",\n                            \"lessThanOrEqual\": \"6.6.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.12.112\",\n                            \"lessThanOrEqual\": \"6.12.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.18.54\",\n                            \"lessThanOrEqual\": \"6.18.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"7.2.8\",\n                            \"lessThanOrEqual\": \"7.2.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"7.3\",\n                            \"lessThanOrEqual\": \"*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"original_commit_for_fix\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"severity":"HIGH"}],"references":["https://git.kernel.org/stable/c/ddb43ac0926d4a931bc9b7744b93627f627457e5","https://git.kernel.org/stable/c/c79a789aa15180a1543b5db49c343d12e3ec214d","https://git.kernel.org/stable/c/faae1fb4ccf8205806a8802c008798dabeb0205b","https://git.kernel.org/stable/c/02c0a2fa69c16248a7432af8a6d64ab2a73a5283","https://git.kernel.org/stable/c/d4fc4e37f8a143b0fe83b42c8fb48cf542154fee","https://git.kernel.org/stable/c/1caceeb2d74bbe88223aea55eb8626b4c5f076fd"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-98360","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-98360","identifiers":["CVE-2026-98360"]},"retained":false,"historicalAffected":[]}],"coverage":[]}