[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <924ec53c-2fd9-2e1c-bbb1-3fda49809be4@gmail.com>
Date: Mon, 14 Jun 2021 17:03:32 +1200
From: Michael Schmitz <schmitzmic@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>
Cc: linux-arch <linux-arch@...r.kernel.org>,
Jens Axboe <axboe@...nel.dk>, Oleg Nesterov <oleg@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Richard Henderson <rth@...ddle.net>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
alpha <linux-alpha@...r.kernel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
Arnd Bergmann <arnd@...nel.org>,
Ley Foon Tan <ley.foon.tan@...el.com>,
Tejun Heo <tj@...nel.org>, Kees Cook <keescook@...omium.org>
Subject: Re: Kernel stack read with PTRACE_EVENT_EXIT and io_uring threads
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:
>>
>> 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
>
>
>
>>
>> Linus
Powered by blists - more mailing lists