[LTS 9.2] KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache #454
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[LTS 9.2]
CVE-2024-26598
VULN-8190
Problem
https://access.redhat.com/security/cve/CVE-2024-26598
Applicability: yes
No clear "fixes" commit provided in the mainline fix ad362fe to check
ciqlts9_2
's history for, but the applicability of the bug is highly likely, given that:The patch was applied to
ciqlts9_4
by RH in 97e30cd.The patch was also applied to Linux stable 5.15 in 12c2759.
The affected file
arch/arm64/kvm/vgic/vgic-its.c
barely differs betweenciqlts9_4
,ciqlts9_2
andlinux-5.15.y
. Compare the history (this is around 30% of its history, with the additional 106 commits of this file under previous pathvirt/kvm/arm/vgic/vgic-its.c
shared one-to-one between all versions):The racing "DISCARD command" mentioned in the mainline's fix ad362fe message can be found in
ciqlts9_2
's version of thearch/arm64/kvm/vgic/vgic-its.c
filekernel-src-tree/arch/arm64/kvm/vgic/vgic-its.c
Lines 837 to 841 in f85f16c
These arguments are heuristic, but fully understanding the potential UAF scenario described in the bug and checking
ciqlts9_2
's code against it would be prohibitively time consuming.Solution
The mainline fix ad362fe applies without any changes.
kABI check: passed
Boot test: passed
boot-test.log
Kselftests: passed relative
The tests were run in a KVM-based VM on a WHLE board with the Layerscape LS1046 microprocessor based on Arm Cortex-A721.
Unfortunately the most interesting
kvm:*
tests relating to the modified module couldn't be launched, as that required support for nested virtualization, which for thearm64
architecture was introduced in the ARMv8.3 revision2, while Cortex-A72 is ARMv83, 4. The kernel reportsduring boot up and the
kvm:*
selftests complain about/dev/kvm
not being available.The test runs are split into two batches because of the
net/forwarding:tc_police.sh
test hanging the machine and interrupting the first batch prematurely.Coverage
Including the omitted tests
bpf
(excepttest_kmod.sh
,test_progs-no_alu32
,test_progs
,test_xsk.sh
,test_sockmap
,test_maps
),breakpoints
(exceptstep_after_suspend_test
),capabilities
,cgroup
(excepttest_freezer
),clone3
,core
,cpu-hotplug
,cpufreq
,drivers/dma-buf
,drivers/net/bonding
,drivers/net/team
,efivarfs
,filesystems/binderfs
,filesystems
,firmware
,fpu
,ftrace
,futex
,gpio
,intel_pstate
,ipc
,ir
,kcmp
,kvm
,landlock
,lib
,livepatch
,membarrier
,memfd
,memory-hotplug
,mincore
,mount
,mqueue
,nci
,net/forwarding
(exceptmirror_gre_bridge_1d_vlan.sh
,sch_tbf_root.sh
,sch_red.sh
,ipip_hier_gre_keys.sh
,vxlan_bridge_1d_ipv6.sh
,sch_tbf_prio.sh
,tc_police.sh
,tc_actions.sh
,gre_inner_v6_multipath.sh
,sch_tbf_ets.sh
,q_in_vni.sh
,sch_ets.sh
,mirror_gre_vlan_bridge_1q.sh
),net/mptcp
(exceptmptcp_join.sh
,userspace_pm.sh
,simult_flows.sh
),net
(exceptxfrm_policy.sh
,gro.sh
,udpgro_fwd.sh
,fib_nexthops.sh
,reuseaddr_conflict
,ip_defrag.sh
,txtimestamp.sh
,reuseport_addr_any.sh
),netfilter
(exceptnft_trans_stress.sh
),nsfs
,openat2
,pid_namespace
,pidfd
,proc
(exceptproc-uptime-001
),pstore
,ptrace
,rlimits
,rseq
,seccomp
,sgx
,sigaltstack
,size
,splice
,static_keys
,syscall_user_dispatch
,tc-testing
,tdx
,timens
,timers
,tmpfs
,tpm2
,vDSO
,vm
,zram
Reference
bpf:get_cgroup_id_user
-net:vrf_strict_mode_test.sh
batch:kselftests–ciqlts9_2–run1.log
kselftests–ciqlts9_2–run2.log
net/forwarding:tc_shblocks.sh
-zram:zram.sh
batch:kselftests–ciqlts9_2–run3.log
kselftests–ciqlts9_2–run4.log
kselftests–ciqlts9_2–run5.log
Patch
bpf:get_cgroup_id_user
-net:vrf_strict_mode_test.sh
batch:kselftests–ciqlts9_2-CVE-2024-26598–run1.log
kselftests–ciqlts9_2-CVE-2024-26598–run2.log
net/forwarding:tc_shblocks.sh
-zram:zram.sh
batch:kselftests–ciqlts9_2-CVE-2024-26598–run3.log
kselftests–ciqlts9_2-CVE-2024-26598–run4.log
kselftests–ciqlts9_2-CVE-2024-26598–run5.log
Comparison
The test results are the same for the reference kernel and the patch.
Specific tests: skipped
Footnotes
1 https://www.nxp.com/products/LS1046A
2 https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-a-architecture-2016-additions
3 https://en.wikipedia.org/wiki/ARM_architecture_family
4 https://en.wikipedia.org/wiki/Comparison_of_ARM_processors#ARMv8-A