[LTS 9.2 RT] CVE-2023-4623, VULN-6713 #140
Merged
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 RT]
CVE-2023-4623
VULN-6713
Problem
https://www.cve.org/CVERecord?id=CVE-2023-4623
Analysis and solution
A single commit was identified as a fix for this issue: b3d26c5702c7d6c45456326e56d2ccf3f103e60f net/sched: sch_hfsc: Ensure inner classes have fsc curve.
The solution consisted of rejecting the addition of a class with a link-sharing curve to the class without it (see Specific tests for details):
The fix introduced a problem with existing network setup scripts for some users https://lore.kernel.org/all/[email protected]/:
It was decided to fix the problem without breaking backwards compatibility https://lore.kernel.org/all/[email protected]/:
The solution was to change the erroneous qdisc hierarchy to a correct one when the possible UAF condition was detected https://lore.kernel.org/all/[email protected]/:
The fix of the fix is given in the commit a13b67c9a015c4e21601ef9aa4ec9c5d972df1b4 net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner curve
While the changes could be squashed into a single commit it was decided to retain the sequence of two commits for more straightforward LTS 9.2 RT - mainline patches correspondence.
The same solution was used already in other "version 9" branches
centos9
,ciqlts9_4
,rocky9_4
,rocky9_5
,sig-cloud-9/5.14.0-427.37.1.el9_4
,sig-cloud-9/5.14.0-427.40.1.el9_4
,sig-cloud-9/5.14.0-427.42.1.el9_4
,sig-cloud-9/5.14.0-503.19.1.el9_5
,sig-cloud-9/5.14.0-503.22.1.el9_5
:kABI check: omitted (unstable ABI of RT kernels)
Boot test: passed
Refer to Specific tests for implicit boot test passing.
Kselftests: passed relative
Methodology
A mix of
kernel-selftests-internal
and source-compiled tests were used:kernel-selftests-internal
:bpf
tests, except:bpf:test_kmod.sh
: takes very long time to finish and always fails anyway,bpf:test_progs
: unstable, can crash the machine,bpf:test_progs-no_alu32
: unstable, can crash the machine.Coverage (including tests skipped during execution)
bpf
,breakpoints
,capabilities
,clone3
,core
,cpu-hotplug
,cpufreq
,drivers/dma-buf
,drivers/net/bonding
,drivers/net/team
,efivarfs
,filesystems
,filesystems/binderfs
,filesystems/epoll
,firmware
,fpu
,ftrace
,futex
,gpio
,intel_pstate
,ipc
,ir
,kcmp
,kvm
,landlock
,lib
,livepatch
,membarrier
,memfd
,memory-hotplug
,mincore
,mount
,mqueue
,nci
,net
,net/forwarding
,net/mptcp
,netfilter
,nsfs
,openat2
,pid_namespace
,pidfd
,pstore
,ptrace
,rlimits
,rseq
,rtc
,seccomp
,sgx
,sigaltstack
,size
,splice
,static_keys
,sync
,syscall_user_dispatch
,sysctl
,tc-testing
,tdx
,timens
,timers
,tmpfs
,tpm2
,user
,vDSO
,vm
,x86
,zram
Reference
ciqlts9_2-rt
(4c5f656231e024966e5df6be5a66e3adf36379fb
)Three test runs were conducted on the reference kernel.
kselftests–mixed–ciqlts9_2-rt–run1.log
kselftests–mixed–ciqlts9_2-rt–run2.log
kselftests–mixed–ciqlts9_2-rt–run3.log
Patch
ciqlts9_2-rt-CVE-2023-4623
(752717727a98bd7e29840fc4c65f8721aaae6a10
)A single test run was conducted on the patched kernel.
kselftests–mixed–ciqlts9_2-rt-CVE-2023-4623.log
Comparison
All of the tests with different results in the tested patch showed inconsistent behavior in the reference tests set itself. The
net/mptcp:mptcp_join.sh
test have shown inconsistent behavior before. Likelynet:gro.sh
,rtc:rtctest
,net:txtimestamp.sh
, although not yet on theciqlts9_2-rt
platform. Added to the list of flappy tests.The
net:udpgso_bench.sh
did show inconsistent behavior before across different platforms but not on a single one. The one failing test seems to be associated with resources depletionThe
x86:syscall_numbering_64
shows inconsistent behavior for the first time. All problems are associated with associatedMODIFIED_BY_PTRACE
errno, and returning -38 by the system call instead (ENOSYS 38 Function not implemented
):The details of this failure were not investigated further
Specific tests: passed
The potential UAF condition was found to be reproducible with the following
tc
commands sequence:The "100kbps", "50kbps" parts are arbitrary. What's important is the use of
rt
for the inner class andls
for the leaf class. While the exact UAF was not obtained the commands helped confirm the efficacy of the patch.Reference
The incorrect qdisc hierarchy can be created without any guardrails.
Full logs:
fix-replicate–ciqlts9_2-rt.log
Patch
Creating the incorrect qdisc hierarchy raises a warning, but succeeds. Notice the type of inner class being
sc
instead ofrt
as shown bytc -g class show dev lo
command.Full logs:
fix-replicate–ciqlts9_2-rt-CVE-2023-4623.log