Thread (4 messages) 4 messages, 3 authors, 2021-06-14

Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads

From: Michael Schmitz <schmitzmic@gmail.com>
Date: 2021-06-14 05:05:02
Also in: linux-arch, linux-m68k, lkml

Possibly related (same subject, not in this thread)

On second thought, I'm not certain what adding another empty stack frame 
would achieve here.

On m68k, 'frame' already is a new stack frame, for running the new 
thread in. This new frame does not have any user context at all, and 
it's explicitly wiped anyway.

Unless we save all user context on the stack, then push that context to 
a new save frame, and somehow point get_signal to look there for IO 
threads (essentially what Eric suggested), I don't see how this could work?

I must be missing something.

Cheers,

	Michael Schmitz

Am 14.06.2021 um 14:05 schrieb Michael Schmitz:
quoted
I wouldn't be surprised if m68k has the exact same thing for the exact
same reason, but I didn't check..
m68k is indeed similar, it has:

       if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
                /* kernel thread */
                memset(frame, 0, sizeof(struct fork_frame));
                frame->regs.sr = PS_S;
                frame->sw.a3 = usp; /* function */
                frame->sw.d7 = arg;
                frame->sw.retpc = (unsigned long)ret_from_kernel_thread;
                p->thread.usp = 0;
                return 0;
        }

so a similar patch should be possible.

Cheers,

    Michael


quoted
                   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