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

Update based on Rev0.5 feedbacks #47

Merged
merged 51 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0346bd0
- Update the wording and add change overview in intro
Jun 3, 2024
83bcd85
- Change the term submachin mode to supervisor domain
Jun 3, 2024
69efb21
- Update the wording
Jun 3, 2024
809d87b
- Update according to feedback
Jun 4, 2024
9496c7f
Merge pull request #38 from riscv-non-isa/wording_update
joxie Jun 8, 2024
fd8d2d6
- Add Terminology subsection
AoteJin Jun 17, 2024
19dc3dc
- Roll back the Terminology subsection
AoteJin Jun 18, 2024
d15d52b
Merge pull request #39 from riscv-non-isa/wording_update
joxie Jun 18, 2024
08dca0d
Fix wording for introduction section
joxie Jun 18, 2024
f3bb4f8
Update wording for introduction
joxie Jun 18, 2024
542832a
Update wording for threat modeling chapter
joxie Jun 19, 2024
179b20f
Wording update for threat model chapter
joxie Jun 19, 2024
b861056
Merge branch 'rev0.5_feedback' of https://github.com/riscv-non-isa/ri…
joxie Jun 24, 2024
6d26287
Update wordings in intro chapter
joxie Jun 24, 2024
8180f45
- Add back terminology subsection
AoteJin Jun 24, 2024
f396197
Wording update
joxie Jun 24, 2024
7071ab4
- Wording update and fix inaccurate description
AoteJin Jun 25, 2024
aa7b1e3
Merge branch 'rev0.5_feedback' into wording_update
AoteJin Jun 25, 2024
aed25a9
Merge pull request #42 from riscv-non-isa/wording_update
joxie Jun 25, 2024
0ff65ad
- Wording update
AoteJin Jun 26, 2024
2218567
Merge remote-tracking branch 'refs/remotes/origin/wording_update' int…
AoteJin Jun 26, 2024
2a2d4af
Merge pull request #43 from riscv-non-isa/wording_update
joxie Jun 27, 2024
b3ffa78
wording update
joxie Jun 27, 2024
01d2408
wording update
joxie Jun 28, 2024
863df23
- Wording update for non-ISA extension
AoteJin Jun 28, 2024
a7a8063
Merge pull request #44 from riscv-non-isa/wording_update
joxie Jun 28, 2024
2e87d78
Wording update
joxie Jun 28, 2024
5a6f8fb
wording update
joxie Jun 28, 2024
d705383
update pdf
joxie Jun 28, 2024
d5c73f6
wording update
joxie Jun 28, 2024
a3d5305
Wording update
joxie Jun 28, 2024
5b57f33
Wording update & comments to be resolved
joxie Jun 30, 2024
0091ba5
- Make the prv and v in dcsr WARL and eliminate secfault error
AoteJin Jul 1, 2024
3a68bbb
Wording update (need to remove comments)
joxie Jul 1, 2024
c0aa2cc
Merge branch 'rev0.5_feedback' into wording_update
joxie Jul 1, 2024
e33b280
Merge pull request #45 from riscv-non-isa/wording_update
joxie Jul 1, 2024
223e19b
wording update
joxie Jul 1, 2024
4afbefb
wording udpate
joxie Jul 1, 2024
3dcbad7
update pdf
joxie Jul 1, 2024
a6a8347
Update
joxie Jul 1, 2024
8c89f15
- Update external trigger and dmode section
AoteJin Jul 2, 2024
d5c8ae1
Update bit field for Smsdedbg and Smsdetrc
joxie Jul 2, 2024
d3a72ef
Fix wording issue for sberror
joxie Jul 2, 2024
24c16ef
- fix wording
AoteJin Jul 2, 2024
dc59dc4
Merge remote-tracking branch 'refs/remotes/origin/rev0.5_feedback' in…
AoteJin Jul 2, 2024
e1e4baa
- Replace "machine mode" with "M-mode"
AoteJin Jul 2, 2024
916bb79
- Remove modifications to intctl and sselect
AoteJin Jul 2, 2024
656e91b
Update chapter2.adoc
AoteJin Jul 11, 2024
5032841
- Update the wording
AoteJin Jul 15, 2024
494cae1
- Update the behavior for physical memory access (with aamvirtual=0)
AoteJin Jul 22, 2024
dbde38f
- Update the description of 'aamvirtual'
AoteJin Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appendix.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ As outlined in the specification, the security control on the Debug Module can v

The privilege level of the hart is determined by code execution, while the debug requests are validated against the privilege level generated by the hart. This process involves two actors, which may lead to a potential Time-of-Check Time-of-Use (TOCTOU) issue. To mitigate this, the implementation must ensure that the inspection and execution of debug requests occur within the same privilege level of the hart. Failure to do so could result in debug requests bypassing access controls intended for higher privilege levels. If the accesses fail the security check, it must prompt an immediate termination of access to prevent any information leakage.

When the external debugger is stepping through an instruction that triggers a transition to a higher privilege level, the security control logic must verify against debug capability according to <<dbgpriv>> before entering Debug Mode. If debugging is permitted, the hart re-enters Debug Mode after executing the instruction. Otherwise, the hart continues executing with the pending single step request until it becomes debuggable and can re-enter Debug Mode. In scenarios where multiple submachine mode software are debuggable, the secure monitor in machine mode may switch the context during single stepping. In such cases, the debugger might stop in a different application than the original one. Users of the debugger should be mindful of this possibility.
When the external debugger is stepping through an instruction that triggers a transition to a higher privilege level, the security control logic must verify against debug capability according to <<dbgpriv>> before entering Debug Mode. If debugging is permitted, the hart re-enters Debug Mode after executing the instruction. Otherwise, the hart continues executing with the pending single step request until it becomes debuggable and can re-enter Debug Mode. In scenarios where multiple supervisor domains are debuggable, the secure monitor in M-mode may switch the context during single stepping. In such cases, the debugger might stop in a different application than the original one. Users of the debugger should be mindful of this possibility.

Application-level debugging is primarily accomplished through self-hosted debugging, allowing the management of debug policies at the supervisor/hypervisor level. As a result, user-level debugging management is not addressed within this extension.

[[extdbg]]
image::external_debug_dm.png[title="The security control on Debug Module",align="center"]

=== Trace Encoder security control
Expand Down
8 changes: 2 additions & 6 deletions chapter1.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
[[threatmodel]]
== External Debug Security Threat model

The growing complexity of modern System-on-Chip (SoC) designs has led to a corresponding increase in the need for effective debugging capabilities. However, the use of debugging functions also introduces potential security vulnerabilities that can be exploited by attackers to gain unauthorized access to sensitive information or perform malicious actions on the system.
Modern SoC development consists of several different actors who may not trust each other, resulting in the need to isolate actors’ assets during the development and debugging phases. The current RISC-V Debug specification cite:[dbgspec] grants external debuggers the highest privilege in the system regardless of the privilege level at which the target system is running. This leads to privilege escalation issues when multiple actors are present.

Modern SoC development consists of several different actors who may not trust each other, resulting in the need to isolate actors’ assets during the development and debugging phases. The current RISC-V Debug specification grants external debuggers the highest privilege in the system regardless of the privilege level at which the target system is running. This leads to privilege escalation issues when multiple actors are present.

For example, the owner of a SoC, who needs to debug their M-mode firmware, may be able to use the external debugger to bypass PMP.L and attack Boot ROM (the SoC creator’s asset).
For example, the owner of a SoC, who needs to debug their M-mode firmware, may be able to use the external debugger to bypass PMP lock (pmpcfg.L=1) and attack Boot ROM (the SoC creator’s asset).

Additionally, RISC-V privilege architecture supports multiple software entities or "supervisor domains" that do not trust each other. The supervisor domains are managed by secure monitor running in M-mode, they are isolated from each other by PMP/IOPMP and they may need different debug policies. The entity that owns secure monitor wants to disable external debug when shipping the secure monitor, however, the entity that owns the supervisor domain needs to enable external debug to develop the supervisor domain. Since the external debugger will be the granted highest privilege in the system, a malicious supervisor domain will be able to compromise M-mode secure monitor with the external debugger.

This specification defines non-ISA extensions and ISA extensions to address the above security issues in the current RISC-V Debug specification.




Expand Down
Loading
Loading