public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: "Shi, Yang" <yang.shi@linaro.org>
Cc: davem@davemloft.net, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linaro-kernel@lists.linaro.org
Subject: Re: [V2 PATCH] sparc64/gup: check address scope legitimacy
Date: Sat, 5 Dec 2015 10:59:56 +0100	[thread overview]
Message-ID: <20151205095956.GA21826@ravnborg.org> (raw)
In-Reply-To: <5660C0D4.8050800@linaro.org>

> >access_ok() always returns 1.
> 
> Thanks for pointing it out. And, I didn't notice that gup is just built for
> SPARC64. I though it is built by both 64 bit and 32 bit.
> 
> A follow-up question, is there any reason to just have sparc specific fast
> gup for 64 bit not for 32 bit?
I do not know - sorry.

> >>@@ -203,6 +206,8 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
> >>  	addr = start;
> >>  	len = (unsigned long) nr_pages << PAGE_SHIFT;
> >>  	end = start + len;
> >>+	if (end < start)
> >>+		goto slow_irqon;
> >
> >end can only be smaller than start if there is some overflow.
> >See how end is calculated just the line above.
> >
> >This looks like a highly suspicious change.
> 
> I'm supposed this is used to protect the overflow. I copied the code from
> other arch. Actually, every arch has this except sparc.
The the other archs are likely confused as well - there is most
likely some history behind that can be found if digging a little.

The code is not present in the generic version.

	Sam

  reply	other threads:[~2015-12-05 10:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 22:31 [PATCH] sparc64/gup: check address scope legitimacy Yang Shi
2015-11-25 22:45 ` [V2 PATCH] " Yang Shi
2015-12-03 20:38   ` Sam Ravnborg
2015-12-03 22:23     ` Shi, Yang
2015-12-05  9:59       ` Sam Ravnborg [this message]
2015-11-26  0:26 ` [PATCH] " kbuild test robot
2015-11-26  0:31   ` Shi, Yang

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=20151205095956.GA21826@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=davem@davemloft.net \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=yang.shi@linaro.org \
    /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