In the Linux kernel, the following vulnerability has been resolved: cxl/port: Fix deleteendpoint() vs parent unregistration race The CXL subsystem, at cxlmem ->probe() time, establishes a lineage of ports (struct cxlport objects) between an endpoint and the root of a CXL topology. Each port including the endpoint port is attached to the cxlport driver. Given that setup, it follows that when either any port in that lineage goes through a cxlport ->remove() event, or the memdev goes through a cxlmem ->remove() event. The hierarchy below the removed port, or the entire hierarchy if the memdev is removed needs to come down. The deleteendpoint() callback is careful to check whether it is being called to tear down the hierarchy, or if it is only being called to teardown the memdev because an ancestor port is going through ->remove(). That care needs to take the devicelock() of the endpoint's parent. Which requires 2 bugs to be fixed: 1/ A reference on the parent is needed to prevent use-after-free scenarios like this signature: BUG: spinlock bad magic on CPU#0, kworker/u56:0/11 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20230524-3.fc38 05/24/2023 Workqueue: cxlport detachmemdev [cxlcore] RIP: 0010:spinbug+0x65/0xa0 Call Trace: dorawspinlock+0x69/0xa0 _mutexlock+0x695/0xb80 deleteendpoint+0xad/0x150 [cxlcore] devresreleaseall+0xb8/0x110 deviceunbindcleanup+0xe/0x70 devicereleasedriverinternal+0x1d2/0x210 detachmemdev+0x15/0x20 [cxlcore] processonework+0x1e3/0x4c0 workerthread+0x1dd/0x3d0 2/ In the case of RCH topologies, the parent device that needs to be locked is not always @port->dev as returned by cxlmemfindport(), use endpoint->dev.parent instead.
{ "availability": "No subscription required", "binaries": [ { "binary_name": "linux-buildinfo-6.5.0-1014-nvidia", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-buildinfo-6.5.0-1014-nvidia-64k", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-headers-6.5.0-1014-nvidia", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-headers-6.5.0-1014-nvidia-64k", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-image-unsigned-6.5.0-1014-nvidia", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-image-unsigned-6.5.0-1014-nvidia-64k", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-image-unsigned-6.5.0-1014-nvidia-64k-dbgsym", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-image-unsigned-6.5.0-1014-nvidia-dbgsym", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-modules-6.5.0-1014-nvidia", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-modules-6.5.0-1014-nvidia-64k", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-modules-extra-6.5.0-1014-nvidia", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-modules-nvidia-fs-6.5.0-1014-nvidia", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-modules-nvidia-fs-6.5.0-1014-nvidia-64k", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-nvidia-6.5-headers-6.5.0-1014", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-nvidia-6.5-tools-6.5.0-1014", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-nvidia-6.5-tools-host", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-tools-6.5.0-1014-nvidia", "binary_version": "6.5.0-1014.14" }, { "binary_name": "linux-tools-6.5.0-1014-nvidia-64k", "binary_version": "6.5.0-1014.14" } ] }