From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261489AbVHBQEK (ORCPT ); Tue, 2 Aug 2005 12:04:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261642AbVHBQCK (ORCPT ); Tue, 2 Aug 2005 12:02:10 -0400 Received: from silver.veritas.com ([143.127.12.111]:41109 "EHLO silver.veritas.com") by vger.kernel.org with ESMTP id S261646AbVHBQB1 (ORCPT ); Tue, 2 Aug 2005 12:01:27 -0400 Date: Tue, 2 Aug 2005 17:03:12 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@goblin.wat.veritas.com To: Linus Torvalds cc: Martin Schwidefsky , Andrew Morton , Robin Holt , linux-kernel , linux-mm@kvack.org, Ingo Molnar , Nick Piggin , Roland McGrath Subject: Re: [patch 2.6.13-rc4] fix get_user_pages bug In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 02 Aug 2005 16:01:26.0275 (UTC) FILETIME=[6FD24530:01C5977B] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Aug 2005, Linus Torvalds wrote: > > On the other hand, this being s390, maybe nobody cares? You have a cruel streak. But have I just realized a non-s390 problem with your pte_dirty technique? The ptep_set_wrprotect in fork's copy_one_pte. That's specifically write-protecting the pte to force COW, but leaving the dirty bit: so now get_user_pages will skip COW-ing it (in all write cases, not just the peculiar ptrace force one). We really do need to COW those in get_user_pages, don't we? And although we could handle it by clearing dirty and doing a set_page_dirty, it's a path we don't want to clutter further. (Yes, there's another issue of a fork occurring while the pages are already under get_user_pages, which is a significant issue for InfiniBand; but I see that as a separate kind of race, which we can reasonably disregard in this discussion - though it will need proper attention, perhaps through Michael Tsirkin's PROT_DONTCOPY patch.) The simple answer to Robin's pagetable update race is to say that anyone using ptrace should be prepared for a pt race ;) Hugh