From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38682 invoked by alias); 18 Mar 2015 18:08:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 38668 invoked by uid 89); 18 Mar 2015 18:08:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 18 Mar 2015 18:08:51 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2II8iq7023792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Mar 2015 14:08:45 -0400 Received: from tranklukator.brq.redhat.com (dhcp-1-208.brq.redhat.com [10.34.1.208]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t2II8f2T031433; Wed, 18 Mar 2015 14:08:42 -0400 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Wed, 18 Mar 2015 19:06:52 +0100 (CET) Date: Wed, 18 Mar 2015 18:08:00 -0000 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) X-SW-Source: 2015-03/txt/msg00551.txt.bz2 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.