All of lore.kernel.org
 help / color / mirror / Atom feed
* 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

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.