pub struct SeccompFilterContainer {
pub filters: Vec<Arc<SeccompFilter>>,
pub provided_instructions: u16,
pub notifier: Option<SeccompNotifierHandle>,
}Expand description
A list of seccomp filters, intended to be associated with a specific process.
Fields§
§filters: Vec<Arc<SeccompFilter>>List of currently installed seccomp_filters; most recently added is last.
provided_instructions: u16§notifier: Option<SeccompNotifierHandle>Implementations§
Source§impl SeccompFilterContainer
impl SeccompFilterContainer
Sourcepub fn can_sync_to(&self, source: &SeccompFilterContainer) -> bool
pub fn can_sync_to(&self, source: &SeccompFilterContainer) -> bool
Ensures that this set of seccomp filters can be “synced to” the given set. This means that our filters are a prefix of the given set of filters.
Sourcepub fn add_filter(
&mut self,
filter: Arc<SeccompFilter>,
original_length: u16,
) -> Result<(), Errno>
pub fn add_filter( &mut self, filter: Arc<SeccompFilter>, original_length: u16, ) -> Result<(), Errno>
Adds the given filter to this list. The original_length parameter is the length of the originally provided BPF (i.e., the number of sock_filter instructions), used to ensure the total length does not exceed SECCOMP_MAX_INSNS_PER_PATH
Sourcepub fn run_all(
&self,
current_task: &CurrentTask,
syscall: &Syscall,
) -> SeccompFilterResult
pub fn run_all( &self, current_task: &CurrentTask, syscall: &Syscall, ) -> SeccompFilterResult
Runs all of the seccomp filters in this container, most-to-least recent. Returns the highest priority result (which contains a reference to the filter that generated it)
Sourcepub fn create_listener(
locked: &mut Locked<Unlocked>,
current_task: &CurrentTask,
) -> Result<FdNumber, Errno>
pub fn create_listener( locked: &mut Locked<Unlocked>, current_task: &CurrentTask, ) -> Result<FdNumber, Errno>
Creates a new listener for use by SECCOMP_RET_USER_NOTIF. Returns its fd.
Trait Implementations§
Source§impl Clone for SeccompFilterContainer
impl Clone for SeccompFilterContainer
Source§impl Default for SeccompFilterContainer
impl Default for SeccompFilterContainer
Source§fn default() -> SeccompFilterContainer
fn default() -> SeccompFilterContainer
Auto Trait Implementations§
impl Freeze for SeccompFilterContainer
impl !RefUnwindSafe for SeccompFilterContainer
impl Send for SeccompFilterContainer
impl Sync for SeccompFilterContainer
impl Unpin for SeccompFilterContainer
impl !UnwindSafe for SeccompFilterContainer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more