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:	Wed, 2 Mar 2011 00:51:24 +0100
From:	Denys Vlasenko <vda.linux@...glemail.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Oleg Nesterov <oleg@...hat.com>,
	Roland McGrath <roland@...hat.com>, jan.kratochvil@...hat.com,
	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org
Subject: Re: [RFC] Proposal for ptrace improvements

On Tue, Mar 1, 2011 at 7:34 PM, Tejun Heo <tj@...nel.org> wrote:
> On Tue, Mar 01, 2011 at 06:21:49PM +0100, Denys Vlasenko wrote:
>> > gdb can do whatever it wants to do but I don't think the above needs
>> > fixing.  In the first case, the user is explicitly telling gdb to
>> > continue the tracee, so it continues as it always has.
>>
>> It does not look like that to me.
>>
>> User attached to some process. User might be unaware that
>> the process is currently stopped (imagine a group of processes
>> which use SIGSTOP/SIGCONT in their normal interactions).
>>
>> User peeked some state, and then wants to let process
>> continue whatever process was doing, but remain in the debugger.
>>
>> What user did not know is that "whatever process was doing" =
>> "being stopped by SIGSTOP, waiting to be woken up".
>> Therefore, if "continue" makes process run, it does not
>> return process to whatever process was doing.
>>
>> > In the latter
>> > case, the debugging session is over.  The tracee now should do
>> > whatever it's supposed to do.
>>
>> It should do that in both cases.
>
> Maybe it should, maybe not, but that's mostly irrelevant because the
> described behavior is the current behavior.

This is not a good argument. We are in this discussion exactly because
there are cases of current behavior in strace and gdb which are clearly
wrong and which we want to change. Therefore, "it's the current
behavior" does not automatically mean it is desired behavior.

> There is no
> continue-if-not-job-control-stopped operation and we shouldn't change
> that beneath gdb

I feel that "continue" is meant to be such operation. Currently
it is not merely because ptrace is buggy.

There is already continue-no-matter-what command in gdb:

(gdb) signal SIGCONT

> because otherwise not only the behavior changes
> unexpectedly

"strace no longer breaks ^Z" is also an unexpected
change in behavior. This doesn't mean we should avoid it,
right?

Bottom line is: I am not trying to shoot your proposal down.
It looks good to me.

I am only discussing it in more detail from the userspace API
POV and from "what changes will be needed in strace and gdb?"
and "what improvements in strace and gdb are becoming possible
with this proposal, and how exactly to implement them there?"
POVs.

-- 
vda
--
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