This is an automated email from the ASF dual-hosted git repository.

ivila pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit 7bd5988da7f861feb10e01b55da3c7e0b46a5ccf
Author: ivila <[email protected]>
AuthorDate: Mon Jul 14 19:03:15 2025 +0800

    crates: secure_db: fix strange `write permission fault`
    
    Signed-off-by: Zehui Chen <[email protected]>
    Reviewed-by: Yuan Zhuang <[email protected]>
    Reviewed-by: Zhaofeng Chen <[email protected]>
---
 crates/secure_db/Cargo.toml | 3 ++-
 crates/secure_db/src/db.rs  | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/crates/secure_db/Cargo.toml b/crates/secure_db/Cargo.toml
index 8396620..d3a70c0 100644
--- a/crates/secure_db/Cargo.toml
+++ b/crates/secure_db/Cargo.toml
@@ -26,4 +26,5 @@ optee-utee = { path = "../../optee-utee" }
 
 bincode = "1.3.3"
 anyhow = "1.0" 
-serde = { version = "1.0", features = ["derive"] }
\ No newline at end of file
+serde = { version = "1.0", features = ["derive"] }
+hashbrown = { version = "0.15.4", features = ["serde"] }
diff --git a/crates/secure_db/src/db.rs b/crates/secure_db/src/db.rs
index eb34d03..a5b08c6 100644
--- a/crates/secure_db/src/db.rs
+++ b/crates/secure_db/src/db.rs
@@ -17,7 +17,8 @@
 
 use crate::{delete_from_secure_storage, load_from_secure_storage, 
save_in_secure_storage};
 use anyhow::{bail, ensure, Result};
-use std::collections::{HashMap, HashSet};
+use hashbrown::HashSet;
+use std::collections::HashMap;
 
 // SecureStorageDb is a key-value storage for TA to easily store and retrieve 
data.
 // First we store the key list in the secure storage, named as db_name.
@@ -40,6 +41,10 @@ impl SecureStorageDb {
                 // create new db
                 Ok(Self {
                     name,
+                    // Note: `std::collections::HashSet` was replaced with
+                    // `hashbrown::HashSet`, due to a write permission fault
+                    // observed during testing. The exact cause of the issue is
+                    // unclear, but using `hashbrown::HashSet` resolves it.
                     key_list: HashSet::new(),
                 })
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to