* Re: kgdb: fix optional arch functions and probe_kernel_* [not found] <200804181742.m3IHgsoG012669@hera.kernel.org> @ 2008-04-18 22:48 ` Andrew Morton 2008-04-21 14:00 ` Ingo Molnar 0 siblings, 1 reply; 4+ messages in thread From: Andrew Morton @ 2008-04-18 22:48 UTC (permalink / raw) To: Ingo Molnar, Jason Wessel; +Cc: Linux Kernel Mailing List On Fri, 18 Apr 2008 17:42:54 GMT Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote: > --- a/mm/maccess.c > +++ b/mm/maccess.c > @@ -17,11 +17,14 @@ > long probe_kernel_read(void *dst, void *src, size_t size) > { > long ret; > + mm_segment_t old_fs = get_fs(); > > + set_fs(KERNEL_DS); > pagefault_disable(); > ret = __copy_from_user_inatomic(dst, > (__force const void __user *)src, size); > pagefault_enable(); > + set_fs(old_fs); > > return ret ? -EFAULT : 0; > } Oh. Well that rather invalidates my earlier comments. It looks like this change could have been folded, but I understand that this sometimes gets wearisome and isn't terribly important if a) the fix doesn't repair build breakage and b) the fix doesn't fix runtime breakage and c) the fix fixes code which the git-bisect user won't have enabled in config anyway. Still. Do we need the set_fs() in there? __copy_from_user_inatomic() is a "__" uaccess function and hence shouldn't be running access_ok()? ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kgdb: fix optional arch functions and probe_kernel_* 2008-04-18 22:48 ` kgdb: fix optional arch functions and probe_kernel_* Andrew Morton @ 2008-04-21 14:00 ` Ingo Molnar 2008-04-21 14:05 ` Jason Wessel 0 siblings, 1 reply; 4+ messages in thread From: Ingo Molnar @ 2008-04-21 14:00 UTC (permalink / raw) To: Andrew Morton; +Cc: Jason Wessel, Linux Kernel Mailing List * Andrew Morton <akpm@linux-foundation.org> wrote: > On Fri, 18 Apr 2008 17:42:54 GMT > Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote: > > > --- a/mm/maccess.c > > +++ b/mm/maccess.c > > @@ -17,11 +17,14 @@ > > long probe_kernel_read(void *dst, void *src, size_t size) > > { > > long ret; > > + mm_segment_t old_fs = get_fs(); > > > > + set_fs(KERNEL_DS); > > pagefault_disable(); > > ret = __copy_from_user_inatomic(dst, > > (__force const void __user *)src, size); > > pagefault_enable(); > > + set_fs(old_fs); > > > > return ret ? -EFAULT : 0; > > } > > Oh. Well that rather invalidates my earlier comments. It looks like > this change could have been folded, but I understand that this > sometimes gets wearisome and isn't terribly important if > > a) the fix doesn't repair build breakage and > > b) the fix doesn't fix runtime breakage and > > c) the fix fixes code which the git-bisect user won't have enabled in > config anyway. yeah. I mentioned it in the pull request that i kept the fixes apart to demonstrate the overall fix dynamics of the KGDB tree over a full kernel cycle. I normally backmerge and create a clean queue - but that creates a false perception that the tree is 'too fresh' and trust is harder to be expressed. > Still. Do we need the set_fs() in there? __copy_from_user_inatomic() > is a "__" uaccess function and hence shouldn't be running access_ok()? yeah, i guess that's true. Jason? Ingo ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kgdb: fix optional arch functions and probe_kernel_* 2008-04-21 14:00 ` Ingo Molnar @ 2008-04-21 14:05 ` Jason Wessel 2008-04-22 13:07 ` Ingo Molnar 0 siblings, 1 reply; 4+ messages in thread From: Jason Wessel @ 2008-04-21 14:05 UTC (permalink / raw) To: Ingo Molnar; +Cc: Andrew Morton, Linux Kernel Mailing List Ingo Molnar wrote: > * Andrew Morton <akpm@linux-foundation.org> wrote: > > >> On Fri, 18 Apr 2008 17:42:54 GMT >> Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote: >> >> >>> --- a/mm/maccess.c >>> +++ b/mm/maccess.c >>> @@ -17,11 +17,14 @@ >>> long probe_kernel_read(void *dst, void *src, size_t size) >>> { >>> long ret; >>> + mm_segment_t old_fs = get_fs(); >>> >>> + set_fs(KERNEL_DS); >>> pagefault_disable(); >>> ret = __copy_from_user_inatomic(dst, >>> (__force const void __user *)src, size); >>> pagefault_enable(); >>> + set_fs(old_fs); >>> >>> return ret ? -EFAULT : 0; >>> } >>> >> Oh. Well that rather invalidates my earlier comments. It looks like >> this change could have been folded, but I understand that this >> sometimes gets wearisome and isn't terribly important if >> >> a) the fix doesn't repair build breakage and >> >> b) the fix doesn't fix runtime breakage and >> >> c) the fix fixes code which the git-bisect user won't have enabled in >> config anyway. >> > > yeah. I mentioned it in the pull request that i kept the fixes apart to > demonstrate the overall fix dynamics of the KGDB tree over a full kernel > cycle. I normally backmerge and create a clean queue - but that creates > a false perception that the tree is 'too fresh' and trust is harder to > be expressed. > > >> Still. Do we need the set_fs() in there? __copy_from_user_inatomic() >> is a "__" uaccess function and hence shouldn't be running access_ok()? >> > > yeah, i guess that's true. Jason? > > In so far as the testing showed, it worked ok on the X86 arch with and without the set_fs(), but on ARM it is absolutely required. This means we have to decide to make arch specific or leave generic as it stands right now. Jason. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kgdb: fix optional arch functions and probe_kernel_* 2008-04-21 14:05 ` Jason Wessel @ 2008-04-22 13:07 ` Ingo Molnar 0 siblings, 0 replies; 4+ messages in thread From: Ingo Molnar @ 2008-04-22 13:07 UTC (permalink / raw) To: Jason Wessel; +Cc: Andrew Morton, Linux Kernel Mailing List * Jason Wessel <jason.wessel@windriver.com> wrote: > >> Still. Do we need the set_fs() in there? > >> __copy_from_user_inatomic() is a "__" uaccess function and hence > >> shouldn't be running access_ok()? > > > > yeah, i guess that's true. Jason? > > In so far as the testing showed, it worked ok on the X86 arch with and > without the set_fs(), but on ARM it is absolutely required. This > means we have to decide to make arch specific or leave generic as it > stands right now. yeah, i guess so - it's no big issue as this isnt performance critical in any way. Do you know which exact codepath/mechanism in ARM relies on the set_fs() being there? Ingo ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-22 13:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200804181742.m3IHgsoG012669@hera.kernel.org>
2008-04-18 22:48 ` kgdb: fix optional arch functions and probe_kernel_* Andrew Morton
2008-04-21 14:00 ` Ingo Molnar
2008-04-21 14:05 ` Jason Wessel
2008-04-22 13:07 ` Ingo Molnar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox