-
Notifications
You must be signed in to change notification settings - Fork 10
[fips-9-compliant] perf: Disallow mis-matched inherited group reads #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fips-9-compliant] perf: Disallow mis-matched inherited group reads #463
Conversation
I don't know what's the consensus on the above addition to the The rest looks good though! |
OK, since we're not explicit including this in the original CVE fix commit and its a What would happen is we might bisect the git history to this commit, read the commit message and assume that 28a6c6e ("perf/core: Fix potential NULL deref") is incorporated into that specific commit and may become confused. Lets strip that out, and move it to the PR statement, the instinct is correct though. |
jira VULN-8891 cve CVE-2023-5717 commit-author Peter Zijlstra <[email protected]> commit 32671e3 upstream-diff This patch causes kABI breakage due to a change in the struct perf_event layout after adding the group_generation field. Hence, to preserve kABI compatibility, use RH_KABI_EXTEND macro to safely append the new field without affecting the existing layout. Because group consistency is non-atomic between parent (filedesc) and children (inherited) events, it is possible for PERF_FORMAT_GROUP read() to try and sum non-matching counter groups -- with non-sensical results. Add group_generation to distinguish the case where a parent group removes and adds an event and thus has the same number, but a different configuration of events as inherited groups. This became a problem when commit fa8c269 ("perf/core: Invert perf_read_group() loops") flipped the order of child_list and sibling_list. Previously it would iterate the group (sibling_list) first, and for each sibling traverse the child_list. In this order, only the group composition of the parent is relevant. By flipping the order the group composition of the child (inherited) events becomes an issue and the mis-match in group composition becomes evident. That said; even prior to this commit, while reading of a group that is not equally inherited was not broken, it still made no sense. (Ab)use ECHILD as error return to indicate issues with child process group composition. Fixes: fa8c269 ("perf/core: Invert perf_read_group() loops") Reported-by: Budimir Markovic <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected] (cherry picked from commit 32671e3) Signed-off-by: Shreeya Patel <[email protected]>
jira VULN-8891 cve-bf CVE-2023-5717 commit-author Peter Zijlstra <[email protected]> commit a71ef31 Smatch is awesome. Fixes: 32671e3 ("perf: Disallow mis-matched inherited group reads") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> (cherry picked from commit a71ef31) Signed-off-by: Shreeya Patel <[email protected]>
020b04c
to
9c7c7ea
Compare
Changes are done as requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚤
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥌
808d229
into
fips-9-compliant/5.14.0-284.30.1
Commit message
Kernel build logs
kernel-build.log
Kselftests
kselftest-after.log
kselftest-before.log