All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aritz Bastida" <aritzbastida@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: MMAP: How a driver can get called on mprotect()
Date: Sun, 5 Mar 2006 19:12:29 +0100	[thread overview]
Message-ID: <7d40d7190603051012p16ed826cx@mail.gmail.com> (raw)

Hello, i have a driver which lets a region of its memory to be mmaped.
The memory can be read and written to from user processes, but sometimes
i just want to let read it, not write it.

I can do that playing with VM_READ and VM_WRITE in the driver's mmap() function,
and refuse to mmap if the user process tries to mmap for writing.

The problem is that, those flags can be changed from userspace with
mprotect() and my mapping count (vma's open and close functions) got
corrupted. Is there any way to get called when the process issues
mprotect(). Should I turn off VM_MAYWRITE and that kind of flags?

I hope my question is clear
Thank you

             reply	other threads:[~2006-03-05 18:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-05 18:12 Aritz Bastida [this message]
2006-03-05 18:22 ` MMAP: How a driver can get called on mprotect() Jan-Benedict Glaw
2006-03-05 18:40   ` Aritz Bastida
2006-03-05 20:18     ` Brice Goglin

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=7d40d7190603051012p16ed826cx@mail.gmail.com \
    --to=aritzbastida@gmail.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.