Skip to content

Commit fe22b1b

Browse files
drwezCQ Bot
authored andcommitted
[sestarnix] Use IndexSet to track pending DirEntrys for labeling
Bug: 388463411 Change-Id: Ie1597935fd2d230628e3183e08c61aecf0957ccc Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1359311 Reviewed-by: Ambre Williams <[email protected]> Fuchsia-Auto-Submit: Wez <[email protected]> Commit-Queue: Wez <[email protected]>
1 parent b2a03c5 commit fe22b1b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/starnix/kernel/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ rustc_library("starnix_core") {
406406
"//third_party/rust_crates:fragile",
407407
"//third_party/rust_crates:futures",
408408
"//third_party/rust_crates:hkdf",
409+
"//third_party/rust_crates:indexmap",
409410
"//third_party/rust_crates:itertools",
410411
"//third_party/rust_crates:linked-hash-map",
411412
"//third_party/rust_crates:lock_api",

src/starnix/kernel/security/selinux_hooks/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use super::{FsNodeSecurityXattr, PermissionFlags, TaskState};
2020
use crate::task::{CurrentTask, FullCredentials, Task};
2121
use crate::vfs::{Anon, DirEntry, FileHandle, FileObject, FileSystem, FsNode, OutputBuffer};
2222
use audit::{Auditable, audit_decision, audit_todo_decision};
23+
use indexmap::IndexSet;
2324
use selinux::permission_check::PermissionCheck;
2425
use selinux::policy::FsUseType;
2526
use selinux::{
@@ -597,15 +598,15 @@ pub(super) struct FileObjectState {
597598
pub(super) struct FileSystemState {
598599
// Fields used prior to policy-load, to hold mount options, etc.
599600
mount_options: FileSystemMountOptions,
600-
pending_entries: Mutex<HashSet<WeakKey<DirEntry>>>,
601+
pending_entries: Mutex<IndexSet<WeakKey<DirEntry>>>,
601602

602603
// Set once the initial policy has been loaded, taking into account `mount_options`.
603604
label: OnceLock<FileSystemLabel>,
604605
}
605606

606607
impl FileSystemState {
607608
fn new(mount_options: FileSystemMountOptions) -> Self {
608-
Self { mount_options, pending_entries: Mutex::new(HashSet::new()), label: OnceLock::new() }
609+
Self { mount_options, pending_entries: Mutex::new(IndexSet::new()), label: OnceLock::new() }
609610
}
610611

611612
/// Returns the resolved `FileSystemLabel`, or `None` if no policy has yet been loaded.

0 commit comments

Comments
 (0)