Re: [PATCH 2/2] selinux: implement mmap on /selinux/policy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2010-07-27 at 12:47 -0400, Stephen Smalley wrote:
> On Mon, 2010-07-26 at 15:34 -0400, Eric Paris wrote:
> > /selinux/policy allows a user to copy the policy back out of the kernel.
> > This patch allows userspace to actually mmap that file and use it directly.
> 
> # checkpolicy -b /selinux/policy
> checkpolicy:  loading policy configuration from /selinux/policy
> Can't map '/selinux/policy':  Invalid argument
> 
> # strace checkpolicy -b /selinux/policy
> ...
> open("/selinux/policy", O_RDONLY)       = 3
> fstat(3, {st_mode=S_IFREG|0400, st_size=5720516, ...}) = 0
> mmap(NULL, 5720516, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = -1 EINVAL
> (Invalid argument)

MAP_SHARED works.  I didn't realize checkpolicy used mmap.  I'll look at
it.

-Eric


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux