Skip to content

Commit

Permalink
core/pta/remote_attestation: apply patch from #6195 for region valida…
Browse files Browse the repository at this point in the history
…tion

Updated is_region_valid function in hash.c to align with changes introduced
in PR #6195. This change improves the handling of region validation by
applying the new read-only region check and excluding unwanted flags as per
the latest patch.

Signed-off-by: Yuichi Sugiyama <[email protected]>
  • Loading branch information
mmxsrup committed Oct 9, 2024
1 parent 0748646 commit 6b0a604
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/pta/remote_attestation/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
* Exclude writable regions as well as those that are not specific to the TA
* (ldelf, kernel or temporary mappings).
*/
static bool is_region_valid(struct vm_region *r) {
uint32_t skip_flags = VM_FLAG_EPHEMERAL | VM_FLAG_PERMANENT | VM_FLAG_LDELF;
static bool is_region_valid(struct vm_region *r)
{
uint32_t dontwant = VM_FLAG_EPHEMERAL | VM_FLAG_PERMANENT |
VM_FLAG_LDELF;
uint32_t want = VM_FLAG_READONLY;

return !(r->flags & skip_flags || r->attr & TEE_MATTR_UW);
return ((r->flags & want) == want && !(r->flags & dontwant));
}

/*
Expand Down

0 comments on commit 6b0a604

Please sign in to comment.