-
Notifications
You must be signed in to change notification settings - Fork 106
MAL-9769 Include latest pckcert in fallback pckcerts request #801
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
Conversation
intel-sgx/dcap-artifact-retrieval/src/provisioning_client/mod.rs
Outdated
Show resolved
Hide resolved
|
Let's get additional certs from:
|
HI @jethrogb , why the 3rd option is needed ? |
|
I want to capture the specific edge case we've identified for our cert iteration logic. |
intel-sgx/pcs/src/tcb_info.rs
Outdated
| (overridden_svn, tcb_level.tcb.pce_svn()) | ||
| } else { | ||
| (cpu_svn, tcb_level.tcb.pce_svn()) | ||
| } |
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.
For cpu_svn != overridden_svn, I was expecting this iterator yields two items: (overridden_svn, tcb_level.tcb.pce_svn()) and (cpu_svn, tcb_level.tcb.pce_svn())
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.
The comment above hasn't been resolved yet. This is also highly specific to the pckcerts_with_fallback function in the dcap-artifact-retrieval crate. It's highly unlikely that there will be other users of this function. Can we move it to that crate/function? By adding it very close to the chaining of the iterators, without a dedicated function, there won't be an expectation anymore that this specific part yields two items.
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.
The problem is self.tcb_levels is private. So I cannot move any logic specific to it to other crates.
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.
Hi @jethrogb , my current approach is chaining the iterators from iter_tcb_components and iter_tcb_components_with_late_tcb_override_only in pckcerts_with_fallback.
Do you mean you want to change it to one iterator that always return overridden_svn and cpu_svn and PceIsvsvn ?
Do you also means, in pckcerts_with_fallback, we do not need to get pckcert with cpu_svn is overridden_svn` is higher?
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.
The problem is self.tcb_levels is private. So I cannot move any logic specific to it to other crates.
We can easily make tcb_level public for TcbData<Verified>
bc08090 to
b5185cf
Compare
intel-sgx/dcap-artifact-retrieval/src/provisioning_client/mod.rs
Outdated
Show resolved
Hide resolved
intel-sgx/dcap-artifact-retrieval/src/provisioning_client/mod.rs
Outdated
Show resolved
Hide resolved
intel-sgx/pcs/src/pckcrt.rs
Outdated
| .position(|comp| comp.comp_type == "Early Microcode Update"); | ||
| let late_idx = tcb_components | ||
| .iter() | ||
| .position(|comp| comp.comp_type == "SGX Late Microcode Update"); |
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.
This likely will go well, but I'm hesitant to rely on the exact string matches here. I think it's more likely that we re-use this code for other platforms/technologies (e.g., PCS v5, TDX, ...) where the descriptions have changed, than that the meaning of cpu svn components change. We could just have take position 0 and 1 in the cpusvn, instead of searching for exact strings. (see also comment below)
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.
We definitely can't rely on the specific ordering of SVN components. Intel makes no guarantees about that.
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.
@raoulstrackx This PR was approved but this comment wasn't addressed.
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.
Created #821 for this
intel-sgx/pcs/src/tcb_info.rs
Outdated
| (overridden_svn, tcb_level.tcb.pce_svn()) | ||
| } else { | ||
| (cpu_svn, tcb_level.tcb.pce_svn()) | ||
| } |
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.
The comment above hasn't been resolved yet. This is also highly specific to the pckcerts_with_fallback function in the dcap-artifact-retrieval crate. It's highly unlikely that there will be other users of this function. Can we move it to that crate/function? By adding it very close to the chaining of the iterators, without a dedicated function, there won't be an expectation anymore that this specific part yields two items.
New logic will get following PCK certs: - PCKID CPUSVN - CPUSVN all 1's - For every CPUSVN we try where the late microcode value is higher than the early microcode value, the CPUSVN where the early microcode value is set to the late microcode value.
5daff92 to
7b20901
Compare
|
I've tested the different ways to get the "problematic" PckCert when the early and late stage microcode code update versions differ, and they all work. I've approved the PR, but I feel someone else should take another look as I wrote large parts myself |
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.
@raoulstrackx changed part looks good to me
No description provided.