Incorrect LAPIC/x2APIC parsing order
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| linux (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
| Noble |
Fix Released
|
Medium
|
Unassigned | ||
| Oracular |
Fix Released
|
Medium
|
Unassigned | ||
Bug Description
[ Impact ]
* In Kernels with commit ec9aedb2aa1a (6.7) CPUs can be enumerated in the order
which violates ACPI specification that states:
"OSPM should initialize processors in the order that they appear in the MADT"
* The problematic commit parses all LAPIC entries before any x2APIC
entries, aiming to ignore x2APIC entries with APIC ID < 255 when valid
LAPIC entries exist. However, it disrupts the CPU enumeration order on
systems where x2APIC entries precede LAPIC entries in the MADT.
* In scenarios with strict CPU pinning this behavior might introduce
performance degradation or hyperthreading related side-channel
vulnerabilities
* Issue has been fixed upstream with commit 0141978ae75
[ Test Plan ]
* Issue reproduces only in specific ACPI MADT configurations with
mixed LAPIC and x2APIC entries. An example of it would be AMD Genoa CPUs.
* Easiest way to reproduce it locally is to replace x2APIC entry
before LAPIC in MADT table.
Steps to reproduce (local VM):
1. Set up a VM with 288 vCPUs
sudo qemu-system-x86_64 -enable-kvm \
-M q35,accel=
-device intel-iommu,
-smp 288,cores=
-m 20G \
-cpu host \
-object memory-
-object memory-
-numa node,cpus=
-numa node,cpus=
-drive file=/var/
-boot d
2. Dump acpi apic/madt tables from VM
acpidump > acpidump.dat
acpixtract -a acpidump.dat
iasl -d apic.dat
----
apic.dsl file will be generated.
3. Craft apic.dsl and switch order of CPUs
4. Compile apic.dsl to aml file
iasl -tc apic.dsl
5. Inject new table to VM
sudo qemu-system-x86_64 -enable-kvm \
-M q35,accel=
-device intel-iommu,
-smp 288,cores=
-acpitable file=apic.aml \
-m 20G \
-cpu host \
-object memory-
-object memory-
-numa node,cpus=
-numa node,cpus=
-drive file=/var/
-boot d
Results:
Depending on MADT changes. For following example I have moved single x2APIC entry
after the first LAPIC.
Incorrect enumeration present on 6.8 Kernels:
NUMA node(s): 2
NUMA node0 CPU(s): 0-143
NUMA node1 CPU(s): 144-287
Enumeration on 6.8 Kernel with applied fixes:
NUMA node(s): 2
NUMA node0 CPU(s): 0,2-144
NUMA node1 CPU(s): 1,145-287
[ Where problems could occur ]
* Fix has been tested using alocal VM with a modified MADT table.
* MADT table can have multiple possible configurations, making it hard to
fully test the fix.
* Potential regression with CPU enumeration can be hard to detect as was in case of
patch that introduced the issue.
[ Other Info ]
* Patch which introduced an issue: ec9aedb2aa1ab7a
* Patch fixing the issue: 0141978ae75bd48
* Originally issue has been reported for AMD Genoa CPU with following enumeration:
6.5.0
NUMA node(s): 2
NUMA node0 CPU(s): 0-89,180-269
NUMA node1 CPU(s): 90-179,270-359
6.8.0
NUMA node(s): 2
NUMA node0 CPU(s): 0-179
NUMA node1 CPU(s): 180-359
CVE References
- 2024-36476
- 2024-39282
- 2024-41932
- 2024-41935
- 2024-43098
- 2024-45828
- 2024-47141
- 2024-47143
- 2024-47408
- 2024-47711
- 2024-47726
- 2024-47794
- 2024-47809
- 2024-48873
- 2024-48875
- 2024-48876
- 2024-48881
- 2024-49568
- 2024-49569
- 2024-49571
- 2024-49865
- 2024-49893
- 2024-49914
- 2024-49920
- 2024-49921
- 2024-49968
- 2024-49972
- 2024-50009
- 2024-50019
- 2024-50020
- 2024-50021
- 2024-50022
- 2024-50023
- 2024-50024
- 2024-50025
- 2024-50026
- 2024-50027
- 2024-50028
- 2024-50029
- 2024-50030
- 2024-50031
- 2024-50033
- 2024-50035
- 2024-50036
- 2024-50038
- 2024-50039
- 2024-50040
- 2024-50041
- 2024-50042
- 2024-50044
- 2024-50045
- 2024-50046
- 2024-50047
- 2024-50048
- 2024-50049
- 2024-50051
- 2024-50055
- 2024-50056
- 2024-50057
- 2024-50058
- 2024-50059
- 2024-50060
- 2024-50061
- 2024-50062
- 2024-50063
- 2024-50064
- 2024-50089
- 2024-50090
- 2024-50093
- 2024-50095
- 2024-50096
- 2024-50117
- 2024-50134
- 2024-50148
- 2024-50171
- 2024-50180
- 2024-50181
- 2024-50182
- 2024-50183
- 2024-50184
- 2024-50185
- 2024-50186
- 2024-50187
- 2024-50188
- 2024-50189
- 2024-50191
- 2024-50229
- 2024-50233
- 2024-51729
- 2024-52319
- 2024-52332
- 2024-53104
- 2024-53156
- 2024-53165
- 2024-53170
- 2024-53179
- 2024-53681
- 2024-53682
- 2024-53685
- 2024-53687
- 2024-53690
- 2024-54191
- 2024-54193
- 2024-54455
- 2024-54460
- 2024-54680
- 2024-54683
- 2024-55639
- 2024-55641
- 2024-55642
- 2024-55881
- 2024-55916
- 2024-56368
- 2024-56369
- 2024-56372
- 2024-56550
- 2024-56551
- 2024-56552
- 2024-56557
- 2024-56558
- 2024-56559
- 2024-56561
- 2024-56562
- 2024-56563
- 2024-56564
- 2024-56565
- 2024-56566
- 2024-56567
- 2024-56568
- 2024-56569
- 2024-56570
- 2024-56572
- 2024-56573
- 2024-56574
- 2024-56575
- 2024-56576
- 2024-56577
- 2024-56578
- 2024-56579
- 2024-56580
- 2024-56581
- 2024-56582
- 2024-56583
- 2024-56584
- 2024-56585
- 2024-56586
- 2024-56587
- 2024-56588
- 2024-56589
- 2024-56590
- 2024-56591
- 2024-56592
- 2024-56593
- 2024-56594
- 2024-56595
- 2024-56596
- 2024-56597
- 2024-56598
- 2024-56599
- 2024-56600
- 2024-56601
- 2024-56602
- 2024-56603
- 2024-56604
- 2024-56605
- 2024-56606
- 2024-56607
- 2024-56608
- 2024-56609
- 2024-56610
- 2024-56611
- 2024-56613
- 2024-56614
- 2024-56615
- 2024-56616
- 2024-56617
- 2024-56618
- 2024-56619
- 2024-56620
- 2024-56621
- 2024-56622
- 2024-56623
- 2024-56624
- 2024-56625
- 2024-56626
- 2024-56627
- 2024-56628
- 2024-56629
- 2024-56630
- 2024-56631
- 2024-56632
- 2024-56633
- 2024-56634
- 2024-56635
- 2024-56636
- 2024-56637
- 2024-56638
- 2024-56639
- 2024-56640
- 2024-56641
- 2024-56642
- 2024-56643
- 2024-56644
- 2024-56645
- 2024-56646
- 2024-56647
- 2024-56648
- 2024-56649
- 2024-56650
- 2024-56651
- 2024-56652
- 2024-56653
- 2024-56654
- 2024-56655
- 2024-56656
- 2024-56657
- 2024-56658
- 2024-56659
- 2024-56660
- 2024-56662
- 2024-56663
- 2024-56664
- 2024-56665
- 2024-56667
- 2024-56669
- 2024-56670
- 2024-56671
- 2024-56672
- 2024-56673
- 2024-56675
- 2024-56709
- 2024-56710
- 2024-56711
- 2024-56712
- 2024-56713
- 2024-56714
- 2024-56715
- 2024-56716
- 2024-56717
- 2024-56718
- 2024-56719
- 2024-56757
- 2024-56758
- 2024-56759
- 2024-56760
- 2024-56761
- 2024-56763
- 2024-56764
- 2024-56765
- 2024-56766
- 2024-56767
- 2024-56768
- 2024-56769
- 2024-56770
- 2024-56771
- 2024-56772
- 2024-56773
- 2024-56774
- 2024-56775
- 2024-56776
- 2024-56777
- 2024-56778
- 2024-56779
- 2024-56780
- 2024-56781
- 2024-56782
- 2024-56783
- 2024-56784
- 2024-56785
- 2024-56786
- 2024-56787
- 2024-57791
- 2024-57792
- 2024-57793
- 2024-57795
- 2024-57798
- 2024-57799
- 2024-57801
- 2024-57802
- 2024-57804
- 2024-57805
- 2024-57806
- 2024-57807
- 2024-57809
- 2024-57838
- 2024-57839
- 2024-57841
- 2024-57843
- 2024-57849
- 2024-57850
- 2024-57857
- 2024-57872
- 2024-57874
- 2024-57875
- 2024-57876
- 2024-57878
- 2024-57879
- 2024-57880
- 2024-57881
- 2024-57882
- 2024-57883
- 2024-57884
- 2024-57885
- 2024-57886
- 2024-57887
- 2024-57888
- 2024-57889
- 2024-57890
- 2024-57892
- 2024-57893
- 2024-57894
- 2024-57895
- 2024-57896
- 2024-57897
- 2024-57898
- 2024-57899
- 2024-57900
- 2024-57901
- 2024-57902
- 2024-57903
- 2024-57904
- 2024-57905
- 2024-57906
- 2024-57907
- 2024-57908
- 2024-57910
- 2024-57911
- 2024-57912
- 2024-57913
- 2024-57916
- 2024-57917
- 2024-57918
- 2024-57919
- 2024-57921
- 2024-57924
- 2024-57925
- 2024-57926
- 2024-57929
- 2024-57931
- 2024-57932
- 2024-57933
- 2024-57934
- 2024-57935
- 2024-57938
- 2024-57939
- 2024-57940
- 2024-57944
- 2024-57945
- 2024-57946
- 2025-21629
- 2025-21630
- 2025-21631
- 2025-21632
- 2025-21633
- 2025-21634
- 2025-21635
- 2025-21636
- 2025-21637
- 2025-21638
- 2025-21639
- 2025-21640
- 2025-21642
- 2025-21643
- 2025-21644
- 2025-21645
- 2025-21646
- 2025-21647
- 2025-21648
- 2025-21649
- 2025-21650
- 2025-21651
- 2025-21652
- 2025-21653
- 2025-21654
- 2025-21655
- 2025-21656
- 2025-21658
- 2025-21659
- 2025-21660
- 2025-21661
- 2025-21662
- 2025-21663
- 2025-21664
| Changed in linux (Ubuntu Noble): | |
| status: | Confirmed → Fix Committed |
| Changed in linux (Ubuntu Oracular): | |
| status: | Confirmed → Fix Committed |
| Changed in linux (Ubuntu Noble): | |
| importance: | Undecided → Medium |
| Changed in linux (Ubuntu Oracular): | |
| importance: | Undecided → Medium |
| tags: | added: kernel-daily-bug |

attaching apic.dsl files