* MMAP: How a driver can get called on mprotect()
@ 2006-03-05 18:12 Aritz Bastida
2006-03-05 18:22 ` Jan-Benedict Glaw
0 siblings, 1 reply; 4+ messages in thread
From: Aritz Bastida @ 2006-03-05 18:12 UTC (permalink / raw)
To: linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MMAP: How a driver can get called on mprotect()
2006-03-05 18:12 MMAP: How a driver can get called on mprotect() Aritz Bastida
@ 2006-03-05 18:22 ` Jan-Benedict Glaw
2006-03-05 18:40 ` Aritz Bastida
0 siblings, 1 reply; 4+ messages in thread
From: Jan-Benedict Glaw @ 2006-03-05 18:22 UTC (permalink / raw)
To: Aritz Bastida; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
On Sun, 2006-03-05 19:12:29 +0100, Aritz Bastida <aritzbastida@gmail.com> wrote:
> 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.
Well, what hardware is it for and where can we download the driver to
have a view at it? That'd probably help suggesting something...
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MMAP: How a driver can get called on mprotect()
2006-03-05 18:22 ` Jan-Benedict Glaw
@ 2006-03-05 18:40 ` Aritz Bastida
2006-03-05 20:18 ` Brice Goglin
0 siblings, 1 reply; 4+ messages in thread
From: Aritz Bastida @ 2006-03-05 18:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Jan-Benedict Glaw
> Well, what hardware is it for and where can we download the driver to
> have a view at it? That'd probably help suggesting something...
>
Well actually is a virtual memory driver somewhat based on scullp
device in the book Linux Device Drivers 3rd edition.
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?
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-03-05 20:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-05 18:12 MMAP: How a driver can get called on mprotect() 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 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.