lkml.org 
[lkml]   [2006]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectMMAP: How a driver can get called on mprotect()
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-06 07:58    [W:0.049 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site