[CBR 7.9] perf: Disallow mis-matched inherited group reads #484
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.
[CBR 7.9]
CVE-2023-5717
VULN-7623
Problem
https://www.cve.org/CVERecord?id=CVE-2023-5717
Applicability: yes
The perf component is included with the
CONFIG_PERF_EVENTS
option, which is enabled in allciqcbr7_9
configsThe commit "flipping the order of child_list and sibling_list" which introduced the bug - fa8c269 - was backported to
ciqcbr7_9
in 170ca9a. The fixing commit 32671e3 is missing and wasn't backported.Solution
The mainline fix 32671e3 adds a new
group_generation
field to theperf_event
struct. This breaks CBR 7.9 kABI. The field was preserved, but moved to the end of the struct and wrapped in theRH_KABI_EXTEND
macro. Unlike in the case of LTS 8.6 (#475) the investigation of whether it's safe to do was not necessary, because the struct already contained multipleRH_KABI_EXTEND(…)
fields at the end, which could not have been added otherwise:kernel-src-tree/include/linux/perf_event.h
Lines 586 to 615 in 10329e4
Additionally, a fix-of-the-fix on the mainlie was commited in a71ef31 which was also included in this backport.
kABI check: passed
Boot test: passed
boot-test.log
Kselftests: passed relative
Reference
kselftests–ciqcbr7_9–run1.log
kselftests–ciqcbr7_9–run2.log
kselftests–ciqcbr7_9–run3.log
Patch
kselftests–ciqcbr7_9-CVE-2023-5717–run1.log
kselftests–ciqcbr7_9-CVE-2023-5717–run2.log
kselftests–ciqcbr7_9-CVE-2023-5717–run3.log
Comparison
The results were compared manually with Meld. No differences indicative of a problem introduced by the patch were found.
Specific tests: passed
While not strictly testing the provided patch, a very basic sanity check of the perf_events module was done to see if it remains functional.
Reference
Patch