public inbox for [email protected]
 help / color / mirror / Atom feed
* Protection key in io uring kthread
@ 2023-05-24  2:48 Jeff Xu
  2023-05-24 15:06 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Xu @ 2023-05-24  2:48 UTC (permalink / raw)
  To: io-uring

Hi
I have a question on the protection key in io_uring. Today, when a
user thread enters the kernel through syscall, PKRU is preserved, and
the kernel  will respect the PKEY protection of memory.

For example:
sys_mprotect_pkey((void *)ptr, size, PROT_READ | PROT_WRITE, pkey);
pkey_write_deny(pkey); <-- disable write access to pkey for this thread.
ret = read(fd, ptr, 1); <-- this will fail in the kernel.

I wonder what is the case for io_uring, since read is now async, will
kthread have the user thread's PKUR ?

In theory, it is possible, i.e. from io_uring_enter syscall. But I
don't know the implementation details of io_uring, hence asking the
expert in this list.

Thanks!
-Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-24 19:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24  2:48 Protection key in io uring kthread Jeff Xu
2023-05-24 15:06 ` Jens Axboe
2023-05-24 17:44   ` Jeff Xu
2023-05-24 18:04     ` Jens Axboe
2023-05-24 19:21       ` Jeff Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox