public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Roland McGrath <roland@redhat.com>
Cc: davem@davemloft.net, paulus@samba.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH] Change long to unsigned long in ptrace functions to fix sparse warnings
Date: Thu, 1 May 2008 16:52:17 -0700	[thread overview]
Message-ID: <20080501165217.a571d902.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080501231942.2B5C426FA07@magilla.localdomain>

On Thu,  1 May 2008 16:19:41 -0700 (PDT)
Roland McGrath <roland@redhat.com> wrote:

> I don't know of any problems off hand, but I would testify that there
> aren't any niggling bits there.  Paranoia would suggest comparing object
> code before/after on each arch, since it should not change.
> 

oh gee, it's a ton of code to review, isn't it?  And it's _hard_ review :(

(reviews a bit)

h8300's arch_ptrace() does

	if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) {

ok, the third comparison saved us.  Lucky...

In fact most architectures seem to have copy-n-pasted that test.  I guess
that going from signed to unsigned is safer than vice-versa.



Now what about frv?

	case PTRACE_PEEKUSR: {
		tmp = 0;
		ret = -EIO;
		if ((addr & 3) || addr < 0)
			break;

we broke that.  Maybe it doesn't matter, don't know.



So yeah, it's _probably_ OK, but I'm not sure that it would be smart to
merge it and hope.  Nor would it be a good use of time to check all that
code just to fix a sparse warning.

      parent reply	other threads:[~2008-05-01 23:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-01 23:10 [PATCH] Change long to unsigned long in ptrace functions to fix sparse warnings Paul Mackerras
2008-05-01 23:16 ` David Miller
2008-05-01 23:19   ` Roland McGrath
2008-05-01 23:20     ` Roland McGrath
2008-05-01 23:52     ` Andrew Morton [this message]

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=20080501165217.a571d902.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=roland@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