Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1284510
| From | Sam Ravnborg <sam@ravnborg.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [V2 PATCH] sparc64/gup: check address scope legitimacy |
| Date | 2015-12-05 11:10 +0100 |
| Message-ID | <qChWW-87s-15@gated-at.bofh.it> (permalink) |
| References | <qyRcC-43u-15@gated-at.bofh.it> <qyRmi-4ml-17@gated-at.bofh.it> <qBIPv-1uA-3@gated-at.bofh.it> <qBKxY-2Cl-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> >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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [V2 PATCH] sparc64/gup: check address scope legitimacy Sam Ravnborg <sam@ravnborg.org> - 2015-12-03 21:40 +0100
Re: [V2 PATCH] sparc64/gup: check address scope legitimacy "Shi, Yang" <yang.shi@linaro.org> - 2015-12-03 23:30 +0100
Re: [V2 PATCH] sparc64/gup: check address scope legitimacy Sam Ravnborg <sam@ravnborg.org> - 2015-12-05 11:10 +0100
csiph-web