Thread (67 messages) 67 messages, 10 authors, 2021-08-25

Re: [RFC PATCH 7/9] lsm,io_uring: add LSM hooks to io_uring

From: Stefan Metzmacher <metze@samba.org>
Date: 2021-05-26 14:48:31
Also in: io-uring, linux-fsdevel, selinux

Hi Paul,
quoted hunk ↗ jump to hunk
 #define CREATE_TRACE_POINTS
 #include <trace/events/io_uring.h>
@@ -6537,6 +6538,11 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
 		if (!req->work.creds)
 			return -EINVAL;
 		get_cred(req->work.creds);
+		ret = security_uring_override_creds(req->work.creds);
+		if (ret) {
+			put_cred(req->work.creds);
+			return ret;
+		}
Why are you calling this per requests, shouldn't this be done in
io_register_personality()?

I'm also not sure if this really gains anything as io_register_personality()
only captures the value of get_current_cred(), so the process already has changed to
the credentials (at least once for the io_uring_register(IORING_REGISTER_PERSONALITY)
call).

metze
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help