public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Robin Holt <holt@sgi.com>, Andrew Morton <akpm@osdl.org>,
	Linus Torvalds <torvalds@osdl.org>,
	Roland McGrath <roland@redhat.com>,
	Hugh Dickins <hugh@veritas.com>,
	linux-mm@kvack.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2.6.13-rc4] fix get_user_pages bug
Date: Mon, 1 Aug 2005 12:15:47 +0200	[thread overview]
Message-ID: <20050801101547.GA5016@elte.hu> (raw)
In-Reply-To: <42EDEAFE.1090600@yahoo.com.au>


* Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> Ingo Molnar wrote:
> >* Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> 
> >>Feedback please, anyone.
> >
> >
> >it looks good to me, but wouldnt it be simpler (in terms of patch and 
> >architecture impact) to always retry the follow_page() in 
> >get_user_pages(), in case of a minor fault? The sequence of minor faults 
> 
> I believe this can break some things. Hugh posted an example in his 
> recent post to linux-mm (ptrace setting a breakpoint in read-only 
> text). I think?

Hugh's posting said:

 "it's trying to avoid an endless loop of finding the pte not writable 
  when ptrace is modifying a page which the user is currently protected 
  against writing to (setting a breakpoint in readonly text, perhaps?)"

i'm wondering, why should that case generate an infinite fault? The 
first write access should copy the shared-library page into a private 
page and map it into the task's MM, writable. If this make-writable 
operation races with a read access then we return a minor fault and the 
page is still readonly, but retrying the write should then break up the 
COW protection and generate a writable page, and a subsequent 
follow_page() success. If the page cannot be made writable, shouldnt the 
vma flags reflect this fact by not having the VM_MAYWRITE flag, and 
hence get_user_pages() should have returned with -EFAULT earlier?

in other words, can a named MAP_PRIVATE vma with VM_MAYWRITE set ever be 
non-COW-break-able and thus have the potential to induce an infinite 
loop?

	Ingo

  reply	other threads:[~2005-08-01 10:18 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050801032258.A465C180EC0@magilla.sf.frob.com>
2005-08-01  8:21 ` [patch 2.6.13-rc4] fix get_user_pages bug Nick Piggin
2005-08-01  9:19   ` Ingo Molnar
2005-08-01  9:27     ` Nick Piggin
2005-08-01 10:15       ` Ingo Molnar [this message]
2005-08-01 10:57         ` Nick Piggin
2005-08-01 19:43           ` Hugh Dickins
2005-08-01 20:08             ` Linus Torvalds
2005-08-01 21:06               ` Hugh Dickins
2005-08-01 21:51                 ` Linus Torvalds
2005-08-01 22:01                   ` Linus Torvalds
2005-08-02 12:01                     ` Martin Schwidefsky
2005-08-02 12:26                       ` Hugh Dickins
2005-08-02 12:28                         ` Nick Piggin
2005-08-02 15:19                         ` Martin Schwidefsky
2005-08-02 15:30                       ` Linus Torvalds
2005-08-02 16:03                         ` Hugh Dickins
2005-08-02 16:25                           ` Linus Torvalds
2005-08-02 17:02                             ` Linus Torvalds
2005-08-02 17:27                               ` Hugh Dickins
2005-08-02 17:21                             ` Hugh Dickins
2005-08-02 18:47                               ` Linus Torvalds
2005-08-02 19:20                                 ` Hugh Dickins
2005-08-02 19:54                                   ` Linus Torvalds
2005-08-02 20:55                                     ` Hugh Dickins
2005-08-03 10:24                                       ` Nick Piggin
2005-08-03 11:47                                         ` Hugh Dickins
2005-08-03 12:13                                           ` Nick Piggin
2005-08-03 16:12                                         ` Linus Torvalds
2005-08-03 16:39                                           ` Linus Torvalds
2005-08-03 16:42                                             ` Linus Torvalds
2005-08-03 17:12                                           ` Hugh Dickins
2005-08-03 23:03                                           ` Nick Piggin
2005-08-04 14:14                                           ` Alexander Nyberg
2005-08-04 14:30                                             ` Nick Piggin
2005-08-04 15:00                                               ` Alexander Nyberg
2005-08-04 15:35                                                 ` Hugh Dickins
2005-08-04 16:32                                                   ` Russell King
2005-08-04 15:36                                                 ` Linus Torvalds
2005-08-04 16:29                                               ` Russell King
2005-08-03 10:24                                       ` Martin Schwidefsky
2005-08-03 11:57                                         ` Hugh Dickins
2005-08-02 16:44                         ` Martin Schwidefsky
2005-08-01 15:42   ` Linus Torvalds
2005-08-01 18:18     ` Linus Torvalds
2005-08-03  8:24       ` Robin Holt
2005-08-03 11:31         ` Hugh Dickins
2005-08-04 11:48           ` Robin Holt
2005-08-04 13:04             ` Hugh Dickins
2005-08-01 19:29     ` Hugh Dickins
2005-08-01 19:48       ` Linus Torvalds
2005-08-02  8:07         ` Martin Schwidefsky
2005-08-01 19:57       ` Andrew Morton
2005-08-01 20:16         ` Linus Torvalds
2005-08-02  0:14     ` Nick Piggin
2005-08-02  1:27     ` Nick Piggin
2005-08-02  3:45       ` Linus Torvalds
2005-08-02  4:25         ` Nick Piggin
2005-08-02  4:35           ` Linus Torvalds
2005-08-01 20:03   ` Hugh Dickins
2005-08-01 20:12     ` Andrew Morton
2005-08-01 20:26       ` Linus Torvalds
2005-08-01 20:51       ` Hugh Dickins
2005-08-02 14:02 Dan Higgins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050801101547.GA5016@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=holt@sgi.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=roland@redhat.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox