From: Brice Goglin <Brice.Goglin@ens-lyon.org>
To: Aritz Bastida <aritzbastida@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: MMAP: How a driver can get called on mprotect()
Date: Sun, 05 Mar 2006 15:18:33 -0500 [thread overview]
Message-ID: <440B4799.7030609@ens-lyon.org> (raw)
In-Reply-To: <7d40d7190603051040h17da06caw@mail.gmail.com>
Aritz Bastida wrote:
>Nonetheless the question is the same: a char device with mmap
>implemented can get called any time a new vma is created or destroyed
>(a process creating a new mmap): vma_open() and vma_close().
>
>But if a user process changes the mmap protections calling mprotect()?
>How can the driver know about that? Is there any way to do that?
>
>
You probably want to remove VM_MAYWRITE from vma->vm_flags in the mmap
vm_op of your char device.
For instance, see how the DRM device mmap protection is set when you're
not admin and the device is read-only:
http://sosdg.org/~coywolf/lxr/source/drivers/char/drm/drm_vm.c#L570
Brice
prev parent reply other threads:[~2006-03-05 20:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-05 18:12 Aritz Bastida
2006-03-05 18:22 ` Jan-Benedict Glaw
2006-03-05 18:40 ` Aritz Bastida
2006-03-05 20:18 ` Brice Goglin [this message]
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=440B4799.7030609@ens-lyon.org \
--to=brice.goglin@ens-lyon.org \
--cc=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 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®