FlawAtlas
Search the atlas
UBUNTU-CVE-2024-50226 High

UBUNTU-CVE-2024-50226

In the Linux kernel, the following vulnerability has been resolved: cxl/port: Fix use-after-free, permit out-of-order decoder shutdown In support of investigating an initialization failure report [1], cxl_test was updated to register mock memory-devices after the mock root-port/bus device had been registered. That led to cxl_test crashing with a use-after-free bug with the following signature: cxl_port_attach_region: cxl region3: cxl_host_bridge.0:port3 decoder3.0 add: mem0:decoder7.0 @ 0 next: cxl_switch_uport.0 nr_eps: 1 nr_targets: 1 cxl_port_attach_region: cxl region3: cxl_host_bridge.0:port3 decoder3.0 add: mem4:decoder14.0 @ 1 next: cxl_switch_uport.0 nr_eps: 2 nr_targets: 1 cxl_port_setup_targets: cxl region3: cxl_switch_uport.0:port6 target[0] = cxl_switch_dport.0 for mem0:decoder7.0 @ 0 1) cxl_port_setup_targets: cxl region3: cxl_switch_uport.0:port6 target[1] = cxl_switch_dport.4 for mem4:decoder14.0 @ 1 [..] cxld_unregister: cxl decoder14.0: cxl_region_decode_reset: cxl_region region3: mock_decoder_reset: cxl_port port3: decoder3.0 reset 2) mock_decoder_reset: cxl_port port3: decoder3.0: out of order reset, expected decoder3.1 cxl_endpoint_decoder_release: cxl decoder14.0: [..] cxld_unregister: cxl decoder7.0: 3) cxl_region_decode_reset: cxl_region region3: Oops: general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6bc3: 0000 [#1] PREEMPT SMP PTI [..] RIP: 0010:to_cxl_port+0x8/0x60 [cxl_core] [..] Call Trace: <TASK> cxl_region_decode_reset+0x69/0x190 [cxl_core] cxl_region_detach+0xe8/0x210 [cxl_core] cxl_decoder_kill_region+0x27/0x40 [cxl_core] cxld_unregister+0x5d/0x60 [cxl_core] At 1) a region has been established with 2 endpoint decoders (7.0 and 14.0). Those endpoints share a common switch-decoder in the topology (3.0). At teardown, 2), decoder14.0 is the first to be removed and hits the "out of order reset case" in the switch decoder. The effect though is that region3 cleanup is aborted leaving it in-tact and referencing decoder14.0. At 3) the second attempt to teardown region3 trips over the stale decoder14.0 object which has long since been deleted. The fix here is to recognize that the CXL specification places no mandate on in-order shutdown of switch-decoders, the driver enforces in-order allocation, and hardware enforces in-order commit. So, rather than fail and leave objects dangling, always remove them. In support of making cxl_region_decode_reset() always succeed, cxl_region_invalidate_memregion() failures are turned into warnings. Crashing the kernel is ok there since system integrity is at risk if caches cannot be managed around physical address mutation events like CXL region destruction. A new device_for_each_child_reverse_from() is added to cleanup port->commit_end after all dependent decoders have been disabled. In other words if decoders are allocated 0->1->2 and disabled 1->2->0 then port->commit_end only decrements from 2 after 2 has been disabled, and it decrements all the way to zero since 1 was disabled previously.

Exploit probability Not scored
Published November 9, 2024
Required by Not available
Last source change April 22, 2026

02 / AFFECTED SOFTWARE

Affected packages

Ubuntu:22.04:LTS linux-oracle-6.8

16 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-tegra

2 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.8

14 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.6

29 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-6.5

10 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-6.5

11 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-6.8

15 explicit affected versions

Ubuntu:22.04:LTS linux-realtime

1 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-6.11

2 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia

18 explicit affected versions

Ubuntu:20.04:LTS linux-intel-5.13

7 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.10

26 explicit affected versions

Ubuntu:18.04:LTS linux-gkeop-5.4

37 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-5.19

10 explicit affected versions

Ubuntu:22.04:LTS linux-aws-5.19

10 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.13

13 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.2

13 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.8

17 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.8

11 explicit affected versions

Ubuntu:18.04:LTS linux-gke-5.4

37 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-5.19

8 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.8

4 explicit affected versions

Ubuntu:22.04:LTS linux-allwinner-5.19

8 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.5

19 explicit affected versions

Ubuntu:22.04:LTS linux-riscv

23 explicit affected versions

Ubuntu:18.04:LTS linux-oracle-5.0

7 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8

14 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.2

10 explicit affected versions

Ubuntu:Pro:Realtime:22.04:LTS linux-realtime-6.8

16 explicit affected versions

Ubuntu:18.04:LTS linux-gke-4.15

33 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.13

16 explicit affected versions

Ubuntu:22.04:LTS linux-oracle-6.5

13 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.13

12 explicit affected versions

Ubuntu:18.04:LTS linux-gcp

38 explicit affected versions

Ubuntu:24.04:LTS linux-gcp-6.11

1 explicit affected versions

Ubuntu:20.04:LTS linux-gke

51 explicit affected versions

Ubuntu:20.04:LTS linux-riscv-5.11

13 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.2

10 explicit affected versions

Ubuntu:18.04:LTS linux-aws-5.3

10 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.13

13 explicit affected versions

Ubuntu:24.04:LTS linux-azure-nvidia

1 explicit affected versions

Ubuntu:22.04:LTS linux-intel-iot-realtime

1 explicit affected versions

Ubuntu:20.04:LTS linux-riscv-5.8

10 explicit affected versions

Ubuntu:24.04:LTS linux-raspi-realtime

1 explicit affected versions

Ubuntu:Pro:Realtime:24.04:LTS linux-raspi-realtime

20 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-5.19

8 explicit affected versions

Ubuntu:24.04:LTS linux-azure-6.11

1 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.5

13 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.8

21 explicit affected versions

Ubuntu:20.04:LTS linux-raspi2

6 explicit affected versions

Ubuntu:18.04:LTS linux-gcp-5.3

13 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.2

12 explicit affected versions

Ubuntu:Pro:Realtime:24.04:LTS linux-realtime

20 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-5.19

7 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.5

14 explicit affected versions

Ubuntu:24.04:LTS linux-azure

20 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.11

12 explicit affected versions

Ubuntu:22.04:LTS linux-oem-5.17

26 explicit affected versions

Ubuntu:24.04:LTS linux-realtime

1 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.8

16 explicit affected versions

Ubuntu:16.04:LTS linux-hwe-edge

23 explicit affected versions

Ubuntu:24.04:LTS linux-oem-6.11

7 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.8

13 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.5

14 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.8

5 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-6.2

3 explicit affected versions

Ubuntu:24.04:LTS linux-raspi

23 explicit affected versions

Ubuntu:20.04:LTS linux-azure-fde

26 explicit affected versions

Ubuntu:24.04:LTS linux-ibm

21 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.11

12 explicit affected versions

Ubuntu:18.04:LTS linux-azure

44 explicit affected versions

Ubuntu:24.04:LTS linux-riscv

21 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.8

4 explicit affected versions

Ubuntu:18.04:LTS linux-azure-edge

4 explicit affected versions

Ubuntu:24.04:LTS linux-aws

22 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.0

16 explicit affected versions

Ubuntu:18.04:LTS linux-oracle-5.3

9 explicit affected versions

Ubuntu:20.04:LTS linux-riscv

12 explicit affected versions

Ubuntu:24.04:LTS linux-xilinx

7 explicit affected versions

Ubuntu:24.04:LTS linux-gke

19 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.11

13 explicit affected versions

Ubuntu:24.04:LTS linux

26 explicit affected versions

Ubuntu:24.04:LTS linux-oracle

21 explicit affected versions

Ubuntu:24.04:LTS linux-gkeop

8 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.8

7 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.5

13 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.2

7 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde-6.2

10 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.2

14 explicit affected versions

Ubuntu:24.04:LTS linux-lowlatency

25 explicit affected versions

Ubuntu:22.04:LTS linux-ibm-6.8

12 explicit affected versions

Ubuntu:20.04:LTS linux-gke-5.15

18 explicit affected versions

Ubuntu:24.04:LTS linux-gcp

24 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde-5.19

3 explicit affected versions

Ubuntu:18.04:LTS linux-azure-5.3

16 explicit affected versions

Ubuntu:24.04:LTS linux-oem-6.8

19 explicit affected versions

Ubuntu:18.04:LTS linux-hwe

43 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-5.19

11 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.14

35 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.13

12 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.5

13 explicit affected versions

Ubuntu:18.04:LTS linux-aws-5.0

6 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.11

12 explicit affected versions

Ubuntu:Pro:FIPS-updates:24.04:LTS linux-fips

1 explicit affected versions

Ubuntu:18.04:LTS linux-oem

50 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.5

11 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.11

12 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-lowlatency

15 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.1

27 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.13

12 explicit affected versions

Ubuntu:22.04:LTS linux-azure-5.19

7 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

related USN-7276-1
related USN-7277-1

04 / EVIDENCE

Source records

Open Source Vulnerabilities UBUNTU-CVE-2024-50226

In the Linux kernel, the following vulnerability has been resolved: cxl/port: Fix use-after-free, permit out-of-order decoder shutdown In support of investigating an initialization failure report [1], cxl_test was updated to register mock memory-devices after the mock root-port/bus device had been registered. That led to cxl_test crashing with a use-after-free bug with the following signature: cxl_port_attach_region: cxl region3: cxl_host_bridge.0:port3 decoder3.0 add: mem0:decoder7.0 @ 0 next: cxl_switch_uport.0 nr_eps: 1 nr_targets: 1 cxl_port_attach_region: cxl region3: cxl_host_bridge.0:port3 decoder3.0 add: mem4:decoder14.0 @ 1 next: cxl_switch_uport.0 nr_eps: 2 nr_targets: 1 cxl_port_setup_targets: cxl region3: cxl_switch_uport.0:port6 target[0] = cxl_switch_dport.0 for mem0:decoder7.0 @ 0 1) cxl_port_setup_targets: cxl region3: cxl_switch_uport.0:port6 target[1] = cxl_switch_dport.4 for mem4:decoder14.0 @ 1 [..] cxld_unregister: cxl decoder14.0: cxl_region_decode_reset: cxl_region region3: mock_decoder_reset: cxl_port port3: decoder3.0 reset 2) mock_decoder_reset: cxl_port port3: decoder3.0: out of order reset, expected decoder3.1 cxl_endpoint_decoder_release: cxl decoder14.0: [..] cxld_unregister: cxl decoder7.0: 3) cxl_region_decode_reset: cxl_region region3: Oops: general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6bc3: 0000 [#1] PREEMPT SMP PTI [..] RIP: 0010:to_cxl_port+0x8/0x60 [cxl_core] [..] Call Trace: <TASK> cxl_region_decode_reset+0x69/0x190 [cxl_core] cxl_region_detach+0xe8/0x210 [cxl_core] cxl_decoder_kill_region+0x27/0x40 [cxl_core] cxld_unregister+0x5d/0x60 [cxl_core] At 1) a region has been established with 2 endpoint decoders (7.0 and 14.0). Those endpoints share a common switch-decoder in the topology (3.0). At teardown, 2), decoder14.0 is the first to be removed and hits the "out of order reset case" in the switch decoder. The effect though is that region3 cleanup is aborted leaving it in-tact and referencing decoder14.0. At 3) the second attempt to teardown region3 trips over the stale decoder14.0 object which has long since been deleted. The fix here is to recognize that the CXL specification places no mandate on in-order shutdown of switch-decoders, the driver enforces in-order allocation, and hardware enforces in-order commit. So, rather than fail and leave objects dangling, always remove them. In support of making cxl_region_decode_reset() always succeed, cxl_region_invalidate_memregion() failures are turned into warnings. Crashing the kernel is ok there since system integrity is at risk if caches cannot be managed around physical address mutation events like CXL region destruction. A new device_for_each_child_reverse_from() is added to cleanup port->commit_end after all dependent decoders have been disabled. In other words if decoders are allocated 0->1->2 and disabled 1->2->0 then port->commit_end only decrements from 2 after 2 has been disabled, and it decrements all the way to zero since 1 was disabled previously.

View original source

05 / REFERENCES

Further evidence