kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Inexplicable PROT_EXEC flag set on mmap callback
@ 2016-01-14 16:04 Kenneth Adam Miller
  2016-01-14 16:26 ` Kenneth Adam Miller
  2016-01-14 17:00 ` Mike Krinkin
  0 siblings, 2 replies; 11+ messages in thread
From: Kenneth Adam Miller @ 2016-01-14 16:04 UTC (permalink / raw)
  To: kernelnewbies

I have a custom drive and userland program pair that I'm using for a very
special use case at my workplace where we are mapping specific physical
address ranges into userland memory with a mmap callback. Everything works
together well with a C userland program that calls into our driver's ioctl
and mmap definitions, but for our case we are using an alternative systems
language just for the userland program. That mmap call is failing (properly
as we want) out from the driver's mmap implementation due to the fact that
the vm_flags have the VM_EXEC flag set. We do not want users to be able to
map the memory range as executable, so the driver should check for this as
it does. The issue is in the fact that somewhere between where mmap is
called and when the parameters are given to the driver, the vma->vm_flags
are being set to 255. I've manually checked the values being given to the
mmap call in our non-C binary, and they are *equivalent* in value to that
of the C program.

My question is, is there anything that can cause the vma->vm_flags to be
changed in the trip between when the user land program calls mmap and when
control is delivered to the mmap callback?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160114/f1e6bc90/attachment-0001.html 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-01-16 19:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-14 16:04 Inexplicable PROT_EXEC flag set on mmap callback Kenneth Adam Miller
2016-01-14 16:26 ` Kenneth Adam Miller
2016-01-14 17:00 ` Mike Krinkin
2016-01-14 17:28   ` Kenneth Adam Miller
2016-01-16 17:45     ` Kenneth Adam Miller
2016-01-16 18:08       ` Mike Krinkin
2016-01-16 18:16         ` Kenneth Adam Miller
2016-01-16 18:31           ` Mike Krinkin
2016-01-16 18:32             ` Kenneth Adam Miller
2016-01-16 18:33               ` Kenneth Adam Miller
2016-01-16 19:15                 ` Kenneth Adam Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).