mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] restore protections after forced fault in get_user_pages
Date: Mon, 2 Feb 2004 16:55:11 -0800	[thread overview]
Message-ID: <200402030055.i130tBT3018213@magilla.sf.frob.com> (raw)
In-Reply-To: Linus Torvalds's message of  Monday, 2 February 2004 16:30:18 -0800 <Pine.LNX.4.58.0402021616340.9720@home.osdl.org>

> The follow_page issue should be fixable by just marking the _page_ dirty 
> inside the ptrace routines. I think we do that anyway (or we'd already be 
> buggy wrt perfectly normal writes).

access_process_vm already calls set_page_dirty_locked, in fact.
So things are relatively simple.

I suggested using pte_modify(pte, vma->vm_page_prot).  That is not the
right thing to do, in fact.  For private mappings, the vm_page_prot value
is always unwritable (PAGE_COPY).  So getting the right bits is tiny bit
hairier.  Either it can do:

	if (vma->vm_flags & VM_WRITE)
		entry = pte_mkwrite(entry);

or it can do something branchless like:

	entry = pte_modify(entry, protection_map[vma->vm_flags & 0x7]);

Or maybe there is a more optimal formulation I haven't thought of.


Thanks,
Roland

  parent reply	other threads:[~2004-02-03  0:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-02  7:29 Roland McGrath
2004-02-02 22:46 ` Andrew Morton
2004-02-02 23:09   ` Linus Torvalds
2004-02-02 23:48   ` Roland McGrath
2004-02-02 23:55     ` Linus Torvalds
2004-02-03  0:03       ` Roland McGrath
2004-02-03  0:09       ` Roland McGrath
2004-02-03  0:30         ` Linus Torvalds
2004-02-03  0:42           ` Andrew Morton
2004-02-03  0:55           ` Roland McGrath [this message]
2004-02-03  8:29           ` Ingo Molnar
2004-02-03 10:25           ` Roland McGrath
2004-02-03 17:04             ` Linus Torvalds

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=200402030055.i130tBT3018213@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®