[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
kernel/1000: uvm mmap on character devices uses PROT_EXEC
>Synopsis: uvm mmap on character devices uses PROT_EXEC
>Arrival-Date: Sat Dec 4 19:20:01 MST 1999
>Originator: Andreas Gunnarsson
System : OpenBSD 2.6
Machine : i386
When using mmap on a character device, uvm will ask the device to
mmap with execute permissions regardless of the argument prot to
This won't work with the Brooktree driver which will return an
error if mmap is tried with PROT_EXEC.
Use a kernel with UVM, run fxtv (from ports tree). It will exit
with an error "mmap of driver buffer failed: Invalid argument"
mmap on other devices that won't allow PROT_EXEC will do the same.
I don't know enough about UVM to be brave enough to include a patch,
but if uvm_mmap calls udv_attach (and uvn_attach?) with "prot"
instead of "maxprot" it should work (/usr/src/sys/uvm/uvm_mmap.c).
Don't quote me on this though, I guess PROT_EXEC may be set for a
reason and I haven't tried to find out what side effects this might
A temporary work around to un-break fxtv would be to remove the check
for PROT_EXEC in the brooktree driver:
*** /usr/src/sys/dev/pci/brooktree848.c.old Sun Dec 5 03:10:54 1999
--- /usr/src/sys/dev/pci/brooktree848.c Sun Dec 5 02:35:21 1999
*** 8579,8586 ****
--- 8579,8588 ----
bktr = bktr_cd.cd_devs[unit];
if (nprot & PROT_EXEC)
return( -1 );
if (offset < 0)
return( -1 );