lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 May 2011 11:13:11 +0200
From:	Tejun Heo <tj@...nel.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	jan.kratochvil@...hat.com, vda.linux@...glemail.com,
	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org, indan@....nu
Subject: Re: [PATCH 10/11] ptrace: move JOBCTL_TRAPPING wait to wait(2) and
 ptrace_check_attach()

Hello,

On Thu, May 12, 2011 at 08:20:06PM +0200, Oleg Nesterov wrote:
> Now about GROUP_STOP_TRAPPING. To simplify the discussion, lets
> forget about this series, please recall the previous
> "ptrace: use GROUP_STOP_TRAPPING for PTRACE_DETACH too" change.
> 
> http://marc.info/?l=linux-kernel&m=130486589601593
> 
> In short, it changes __ptrace_unlink() to set _TRAPPING if needed,
> and ptrace_attach() waits for !TRAPPING unconditionally.
> 
> Problem: TRAPPING can be set outside of do_signal_stop() paths, and
> I think we should avoid this as much as possible.

For PTRACE_DETACH, this was true but it isn't true for notification
re-traps.  Notification re-traps happen iff JOBCTL_TRAPPED (now
renamed to JOBCTL_ALLOW_NOTIFY) is set and tracee sets it only while
it's inside signal delivery path - more specifically, when
ptrace_stop() is called from do_signal_stop() or for INTERRUPT trap,
both of which are always inside get_signal_to_deliver().

> (I am ignoring the problem this patch addresses temporary, I think
>  we can fix it a bit differently).

Just leaving it alone also is an option.  We can just mandate
ptrace(2) users to always perform sleeping wait(2) after PTRACE_SEIZE.
If it can be fixed easily, sure.  If not, let's leave it alone.

> Say, the thread group was stopped, the tracer PTRACE_CONT's T1, it calls
> sys_execve() and reports the trap from syscall_trace_enter().
> 
> The tracer does ptrace(T1, DETACH) + ptrace(T1, SEIZE) and hangs forever.
> 
> Once again, this is only one example. coredump, vfork, probably something
> else. In short: I think that TRAPPING-outside-of-do_signal_stop is the
> can of worms.

Yeap, fully agreed.  We need something different for detach case;
however, for re-trap, tracee is known to be in signal delivery path
and should be okay, I think.  Right?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ