Thread (37 messages) 37 messages, 4 authors, 2020-11-16

Re: [PATCH v22 08/12] landlock: Add syscall implementations

From: Jann Horn <jannh@google.com>
Date: 2020-10-30 03:08:25
Also in: linux-api, linux-arch, linux-doc, linux-fsdevel, linux-kselftest, lkml

On Thu, Oct 29, 2020 at 12:30 PM Mickaël Salaün [off-list ref] wrote:
On 29/10/2020 02:06, Jann Horn wrote:
quoted
On Tue, Oct 27, 2020 at 9:04 PM Mickaël Salaün [off-list ref] wrote:
quoted
These 3 system calls are designed to be used by unprivileged processes
to sandbox themselves:
[...]
quoted
quoted
+       /*
+        * Similar checks as for seccomp(2), except that an -EPERM may be
+        * returned.
+        */
+       if (!task_no_new_privs(current)) {
+               err = security_capable(current_cred(), current_user_ns(),
+                               CAP_SYS_ADMIN, CAP_OPT_NOAUDIT);
I think this should be ns_capable_noaudit(current_user_ns(), CAP_SYS_ADMIN)?
Right. The main difference is that ns_capable*() set PF_SUPERPRIV in
current->flags. I guess seccomp should use ns_capable_noaudit() as well?
Yeah. That seccomp code is from commit e2cfabdfd0756, with commit date
in April 2012, while ns_capable_noaudit() was introduced in commit
98f368e9e263, with commit date in June 2016; the seccomp code predates
the availability of that API.

Do you want to send a patch to Kees for that, or should I?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help