pub struct SealedDevice {
pub name: &'static str,
pub path: &'static str,
pub major: u32,
pub minor: u32,
pub mode: u32,
pub writable: bool,
}Expand description
One entry of the private /dev tmpfs.
major/minor/mode are recorded for the record and for the manual-verification document to
assert against — they are not used to create the node. Device nodes cannot be mknoded
from inside a non-initial user namespace at all (the kernel refuses regardless of
CAP_MKNOD), so each entry is created as an empty file in the tmpfs and the host’s node is
bind-mounted over it. This is what bubblewrap and rootless podman do, and it means the numbers
a capsule actually sees are the host’s — which on every mainstream distribution are exactly the
ones below.
Fields§
§name: &'static strName under /dev, without the directory.
path: &'static strThe host path bind-mounted over the tmpfs entry — /dev/ + Self::name, spelled out
because it is also what the composed root’s Landlock rule set is built from.
major: u32§minor: u32§mode: u32§writable: boolWhether the composed root’s Landlock rule for this device carries WriteFile on top of
ReadFile.
Landlock still mediates inside a composed root — that is the whole point of keeping it as
defence in depth — so a device present in /dev but absent from the rule set would exist
and be unopenable, which is worse than not being there. The read-only pair is the two
entropy sources, where nothing legitimate writes; the rest carry write because their write
side is defined to discard (null, zero), to report ENOSPC (full), or to be a
terminal (tty).
Trait Implementations§
Source§impl Clone for SealedDevice
impl Clone for SealedDevice
impl Copy for SealedDevice
Source§impl Debug for SealedDevice
impl Debug for SealedDevice
impl Eq for SealedDevice
Source§impl PartialEq for SealedDevice
impl PartialEq for SealedDevice
impl StructuralPartialEq for SealedDevice
Auto Trait Implementations§
impl Forget for SealedDevice
impl Freeze for SealedDevice
impl Move for SealedDevice
impl RefUnwindSafe for SealedDevice
impl Send for SealedDevice
impl Sync for SealedDevice
impl Unpin for SealedDevice
impl UnsafeUnpin for SealedDevice
impl UnwindSafe for SealedDevice
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<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