From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756430AbbCRSIz (ORCPT ); Wed, 18 Mar 2015 14:08:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43831 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752007AbbCRSIx (ORCPT ); Wed, 18 Mar 2015 14:08:53 -0400 Date: Wed, 18 Mar 2015 19:06:49 +0100 From: Oleg Nesterov To: Andy Lutomirski Cc: Hugh Dickins , Linus Torvalds , Jan Kratochvil , Sergio Durigan Junior , GDB Patches , Pedro Alves , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: install_special_mapping && vm_pgoff (Was: vvar, gup && coredump) Message-ID: <20150318180649.GA853@redhat.com> References: <20150311200052.GA22654@redhat.com> <20150312143438.GA4338@redhat.com> <20150312165423.GA10073@redhat.com> <20150312174653.GA13086@redhat.com> <20150316190154.GA18472@redhat.com> <20150316194446.GA21791@redhat.com> <20150317134309.GA365@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/17, Andy Lutomirski wrote: > > On Tue, Mar 17, 2015 at 6:43 AM, Oleg Nesterov 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 > that. 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 ;) Oleg.