This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3 v4] Remove some GDBSERVER checks from linux-ptrace
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org, Doug Evans <dje at google dot com>
- Date: Thu, 24 Jul 2014 15:13:46 +0100
- Subject: Re: [PATCH 2/3 v4] Remove some GDBSERVER checks from linux-ptrace
- Authentication-results: sourceware.org; auth=none
- References: <1406206287-6817-1-git-send-email-gbenson at redhat dot com> <1406206287-6817-3-git-send-email-gbenson at redhat dot com> <53D108F0 dot 9060100 at redhat dot com> <87oaweonp4 dot fsf at fleche dot redhat dot com>
On 07/24/2014 03:07 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
>>> + current_ptrace_options |= PTRACE_O_TRACECLONE |
>>> + (additional_flags & ~(PTRACE_O_TRACESYSGOOD
>>> + | PTRACE_O_TRACEVFORKDONE));
>
> Pedro> This isn't right. That enables e.g., PTRACE_O_TRACEEXIT, for example,
> Pedro> and possibly invalid flags even.
>
> I don't see how that can happen. I think the "&" prevents it.
If the caller puts PTRACE_O_TRACEEXIT in additional_flags, that'll
enable it, even though that's not what the test that led to that
code was making sure the kernel supported.
(PTRACE_O_TRACEEXIT was added to the kernel at the same time as
PTRACE_EVENT_VFORK_DONE, not the fork/exec flags).
--
Thanks,
Pedro Alves