[PATCH v4] rust: add PidNamespace

Christian Brauner brauner at kernel.org
Wed Oct 2 11:30:50 UTC 2024


On Wed, Oct 02, 2024 at 01:12:08PM GMT, Miguel Ojeda wrote:
> On Wed, Oct 2, 2024 at 1:00 PM Christian Brauner <brauner at kernel.org> wrote:
> >
> > +        let pidns = unsafe { bindings::task_active_pid_ns(Task::current_raw()) };
> 
> Missing `// SAFETY` -- I mention it since this will be a warning (thus
> error in `WERROR`) soon.
> 
> > +        let ptr = unsafe { bindings::task_get_pid_ns(self.0.get()) };
> 
> Ditto.
> 
> > +            Some(pidns) => unsafe { bindings::task_tgid_nr_ns(self.0.get(), pidns.as_ptr()) },
> > +            None => unsafe { bindings::task_tgid_nr_ns(self.0.get(), ptr::null_mut()) },
> 
> Ditto.

Ah, good to know.



More information about the Linux-security-module-archive mailing list