Skip to content

[rtl] Clear branch predictor skid buffer on PC redirect - #2521

Open
zxz2004626 wants to merge 1 commit into
lowRISC:masterfrom
sycuricon:fix-bp
Open

zxz2004626 wants to merge 1 commit into
lowRISC:masterfrom
sycuricon:fix-bp

Conversation

@zxz2004626

@zxz2004626 zxz2004626 commented Sep 30, 2026 •

Copy link
Copy Markdown

This PR is to fix #2520 .

The IF-stage skid buffer introduced with BranchPredictor=1 has no invalidation term for pipeline redirects: an occupied skid survives the controller's FLUSH state, so a predicted-taken branch stranded in the skid is executed as the first post-trap instruction with the raised privilege level. From U-mode this turns any synchronous trap into a U->M privilege escalation.

Invalidate the skid whenever pc_set_i is asserted, mirroring the ~pc_set_i term that already guards fill via instr_skid_en.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@zxz2004626

Copy link
Copy Markdown
Author

I have read the CLA Document. By submitting this pull request comment, I am hereby confirming my acceptance of the terms of the CLA Document and my agreement to be legally bound by its terms.

@SamuelRiedel
SamuelRiedel self-requested a review October 7, 2026 14:31
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.

[Security Bugs] U-mode to M-mode privilege escalation via a branch predictor

1 participant