On Fri, Jul 29, 2016 at 10:34:37AM +0300, Elena Reshetova wrote: > This adds a new security_task_unshare() LSM hook. > It can be used by LSMs concerned about unshare > system call. > > Signed-off-by: Elena Reshetova > --- [...] > @@ -2052,6 +2052,11 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) > if (err) > goto bad_unshare_cleanup_cred; > > + err = security_task_unshare(unshare_flags, new_fs, new_fd, > + new_cred, new_nsproxy); > + if (err) > + goto bad_unshare_cleanup_cred; > + > if (new_fs || new_fd || do_sysvsem || new_cred || new_nsproxy) { > if (do_sysvsem) { > /* Why would you have an LSM hook just for the unshare() syscall given that clone() exposes nearly the same functionality?