[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210312170709.GD27820@redhat.com>
Date: Fri, 12 Mar 2021 18:07:10 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Jim Newsome <jnewsome@...project.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ptrace: Allow other threads to access tracee
On 03/11, Jim Newsome wrote:
>
> I suppose even if the corruption of the register-values-themselves is
> acceptable, some synchronization may be needed to avoid the possibility
> of corrupting the kernel's data structures?
Yes, the kernel can crash. Just look at the comment above ptrace_freeze_traced().
The kernel assumes that the tracee is frozen, in particular it can't exit.
Say, ptrace_peek_siginfo() can crash the tracee exits and clears ->sighand,
and this can obviously happen if another thread does PTRACE_CONT + SIGKILL.
> Is it "just" a matter of adding some locking? Would a relatively coarse
> lock on the target task over the duration of the ptrace call
Yes I think needs a mutex in task_struct. But honestly I am not sure
it makes sense.... I dunno.
> (which I
> believe is always non-blocking?)
Why? It is blocking.
Oleg.
Powered by blists - more mailing lists