Thread (21 messages) 21 messages, 6 authors, 2021-06-22

Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2021-06-21 15:38:39
Also in: linux-arch, linux-m68k, lkml

Possibly related (same subject, not in this thread)

On Mon, Jun 21, 2021 at 6:55 AM Al Viro [off-list ref] wrote:
On Tue, Jun 15, 2021 at 02:58:12PM -0700, Linus Torvalds wrote:
quoted
And I think our horrible "kernel threads return to user space when
done" is absolutely horrifically nasty. Maybe of the clever sort, but
mostly of the historical horror sort.
How would you prefer to handle that, then?  Separate magical path from
kernel_execve() to switch to userland?  We used to have something of
that sort, and that had been a real horror...
Hmm. Maybe the alternatives would all be worse. The current thing is
clever, and shares the return path with the normal case. It's just
also a bit surprising, in that a kernel thread normally must not
return - with the magical exception of "if it had done a
kernel_execve() at some point, then returning is magically the way you
actually start user mode".

So it all feels very special, and there's not even a comment about it.

I think we only have two users of that thing (the very first 'init',
and user-mode-helpr), So I guess it doesn't really matter.

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