This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3 v4] Remove some GDBSERVER checks from linux-ptrace


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]