-
Notifications
You must be signed in to change notification settings - Fork 64
Attempt a basic PC range check as part of hubris.validate
#711
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
a716c34
015a3a3
9d708f0
4f99d53
02df730
0dd349c
2635ae7
1bab5bc
c01d91c
cfa9fe2
b683227
787b3a1
3d1e66b
220886a
e6726f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2103,11 +2103,19 @@ | |||||||||||||||||||||||
| ); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if criteria == HubrisValidate::ArchiveMatch { | ||||||||||||||||||||||||
| if self.task_dump().is_some() { | ||||||||||||||||||||||||
| return Ok(()); | ||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||
| core.halt()?; | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we do
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely yes this got lost in some refactoring 😬 |
||||||||||||||||||||||||
| if let Ok(pc) = core.read_reg(ARMRegister::PC) { | ||||||||||||||||||||||||
| if self.instr_mod(pc).is_none() { | ||||||||||||||||||||||||
| bail!("PC at 0x{pc:x} is not part of any module. This is \ | ||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unimportant turbo nitpick: if we write
Suggested change
that tells the formatter to emit the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the way this interacts with flashing is not ideal. If you try to re-flash an A image that's already been flashed to the A slot while the RoT is running a B image:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah you're right that's confusing behavior. I think that would point to needing to fix validate to return a more specific error
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or don't use |
||||||||||||||||||||||||
| likely an incorrect archive."); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i believe clippy would like you to have written something more like:
Suggested change
|
||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if self.task_dump().is_some() { | ||||||||||||||||||||||||
| if criteria == HubrisValidate::ArchiveMatch { | ||||||||||||||||||||||||
| return Ok(()); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
@labbott What does it mean for an archive to be "a dump from a single task"? I'm wondering if it's intentional/correct that if you pass in
HubrisValidate::Bootedin that case, it returns early here and skips the boot check.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.
I think it's possible to take a dump from only a single task's memory range (e.g. a "single task dump"), but not an "entire system" dump. Laura can confirm though :)
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.
James is correct. We have the notion of single task dumps vs a wholes system dump. You can run many of the same commands like e.g.
humility tasksandhumility ringbufand things should work as expected. I don't think we capture the boot information in a single task dump which is why it gets skipped.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.
Thanks, I added a comment about it.