This is the mail archive of the
mailing list for the GDB project.
Re: install_special_mapping && vm_pgoff (Was: vvar, gup && coredump)
- From: Oleg Nesterov <oleg at redhat dot com>
- To: Andy Lutomirski <luto at amacapital dot net>
- Cc: Hugh Dickins <hughd at google dot com>, Linus Torvalds <torvalds at linux-foundation dot org>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>, GDB Patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, "linux-kernel at vger dot kernel dot org" <linux-kernel at vger dot kernel dot org>, "linux-mm at kvack dot org" <linux-mm at kvack dot org>
- Date: Wed, 18 Mar 2015 19:06:49 +0100
- Subject: Re: install_special_mapping && vm_pgoff (Was: vvar, gup && coredump)
- Authentication-results: sourceware.org; auth=none
- References: <20150311200052 dot GA22654 at redhat dot com> <20150312143438 dot GA4338 at redhat dot com> <CALCETrW5rmAHutzm_OwK2LTd_J0XByV3pvWGyW=AmC=v7rLfhQ at mail dot gmail dot com> <20150312165423 dot GA10073 at redhat dot com> <20150312174653 dot GA13086 at redhat dot com> <20150316190154 dot GA18472 at redhat dot com> <CALCETrU9pLE2x3+vei1xw6B8uu4B33DOEzP03ue9DeS8sJhYUg at mail dot gmail dot com> <20150316194446 dot GA21791 at redhat dot com> <20150317134309 dot GA365 at redhat dot com> <CALCETrVgzCrb6yfb3=MhBDXxtQgRNbsijBER502+Z2rOVKvipQ at mail dot gmail dot com>
On 03/17, Andy Lutomirski wrote:
> On Tue, Mar 17, 2015 at 6:43 AM, Oleg Nesterov <email@example.com> wrote:
> > But at least the bug exposed by the test-case looks clear:
> > do_linear_fault:
> > vmf->pgoff = (((address & PAGE_MASK) - vma->vm_start) >> PAGE_SHIFT)
> > + vma->vm_pgoff;
> > ...
> > special_mapping_fault:
> > pgoff = vmf->pgoff - vma->vm_pgoff;
> > So special_mapping_fault() can only work if this mapping starts from the
> > first page in ->pages.
> > So perhaps we need _something like_ the (wrong/incomplete) patch below...
> > Or, really, perhaps we can create vdso_mapping ? So that map_vdso() could
> > simply mmap the anon_inode file...
> That's slightly tricky, I think, because it could start showing up in
> /proc/PID/map_files or whatever it's called, and I don't think we want
Hmm. To me this looke liks improvement. And again, with this change
uprobe-in-vdso can work.
OK, this is off-topic right now, lets forget this for the moment.
> Your patch does look like a considerable improvement, though. Let me
> see if I can find some time to fold it in with the rest of my special
> mapping rework over the next few days.
I'll try to recheck... Perhaps I'll send this (changed) patch for review.
This is a bugfix, even if the bug is minor.
And note that with this change vvar->access() becomes trivial. I think it
makes sense to fix "gup() fails in vvar" too. Gdb developers have enough
other problems with the poor kernel interfaces ;)