public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arch/tile: provide PT_FLAGS_COMPAT value in pt_regs
Date: Thu, 13 Dec 2012 11:15:13 -0500	[thread overview]
Message-ID: <50C9FF11.2030303@tilera.com> (raw)
In-Reply-To: <20121213154929.GA17421@redhat.com>

On 12/13/2012 10:49 AM, Oleg Nesterov wrote:
> On 12/13, Chris Metcalf wrote:
>> On 12/12/2012 6:43 PM, Oleg Nesterov wrote:
>>> And. arch/tile/kernel/ptrace.c:arch_ptrace() does
>>>
>>> 	case PTRACE_SETOPTIONS:
>>> 		/* Support TILE-specific ptrace options. */
>>> 		child->ptrace &= ~PT_TRACE_MASK_TILE;
>>> 		tmp = data & PTRACE_O_MASK_TILE;
>>> 		data &= ~PTRACE_O_MASK_TILE;
>>>
>>> AFAICS we need something like BUILD_BUG_ON(PTRACE_O_MASK_TILE & PTRACE_O_MASK),
>> I don't think so.  These are disjoint namespaces anyway.
>> PTRACE_O_MASK_TILE is for the actual PTRACE_SETOPTIONS ABI values.
> Yes, and thus it should not intersect with the generic PTRACE_O_MASK, no?

Yes, I misunderstood your original suggestion (I read PTRACE_O_MASK as PT_TRACE_MASK_TILE - oops).  You're quite right that it's a good build bug; I'll add it to the cleanup patch that will also move the task->ptrace bit clear.

>>> 		ret = ptrace_request(child, request, addr, data);
>>> 		if (tmp & PTRACE_O_TRACEMIGRATE)
>>> 			child->ptrace |= PT_TRACE_MIGRATE;
>>>
>>> this also needs "ret == 0" check
>> The question is, what happens if we pass some illegal bit to the generic
>> ptrace_request(), and also pass a valid PTRACE_O_MASK_TILE bit?
>> Currently we set the tile-specific bit, then report the error.
>> This is consistent with how ptrace_setoptions() handles a mix of legal and
>> illegal bits.
> But ptrace_setoptions() returns EINVAL? it doesn't accept illegal bits.

It does return EINVAL - but if it gets both legal and illegal bits, it honors all the legal bits first.  So we honor the PT_TRACE_MIGRATE bit in this code, even if ptrace_request() returns EINVAL.

> So I'd say it looks fine to me.

Thanks!  Should I convert that to a Reviewed-by or Acked-by on the patch?

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


  reply	other threads:[~2012-12-13 16:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 22:24 [PATCH] arch/tile: provide PT_FLAGS_COMPAT value in pt_regs Chris Metcalf
2012-12-12 23:43 ` Oleg Nesterov
2012-12-13 14:58   ` Chris Metcalf
2012-12-13 15:49     ` Oleg Nesterov
2012-12-13 16:15       ` Chris Metcalf [this message]
2012-12-13 16:27         ` Oleg Nesterov
2012-12-13 16:34           ` [PATCH] arch/tile: clean up tile-specific PTRACE_SETOPTIONS Chris Metcalf
2012-12-14 17:26             ` Oleg Nesterov
2012-12-13 16:41           ` [PATCH] arch/tile: provide PT_FLAGS_COMPAT value in pt_regs Chris Metcalf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50C9FF11.2030303@tilera.com \
    --to=cmetcalf@tilera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox