Skip to content
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

i#6373: handle back-to-back signals after an rseq abort. #6374

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

ivankyluk
Copy link
Contributor

@ivankyluk ivankyluk commented Oct 16, 2023

When a signal causes an rseq abort, there will be a rseq abort marker, followed by a kernel event marker.

When another signal follows immediately, another kernel event maker will be added with a different value.

If a back-to-back signal happens without any intervening instructions, the new kernel event marker (3rd one) should have the same value as the second kernel event marker.

The current implementation of the invariant check fails to consider this case, and flag an error.

If the instruction before the rseq marker is a branch, the invariant checker reports "Branch does not go to the correct target @ kernel_event marker", otherwise it reports "Non-explicit control flow has no marker @ kernel_event marker".

The fix is to check if the kernel event marker has the same value as the previous one, and if there are no intervening instructions between signals, do not flag an error.

Fixes: #6373

@ivankyluk ivankyluk merged commit 3fc09e8 into master Oct 17, 2023
15 checks passed
@ivankyluk ivankyluk deleted the i6373-back-to-back-signals branch October 17, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invariant checker does not handle back-to-back signals after an rseq abort correctly.
2 participants