All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov, jmorris@namei.org
Subject: Re: [PATCH 2/2] selinux: implement mmap on /selinux/policy
Date: Tue, 27 Jul 2010 12:50:31 -0400	[thread overview]
Message-ID: <1280249431.23427.126.camel@localhost> (raw)
In-Reply-To: <1280249271.4789.61.camel@moss-pluto.epoch.ncsc.mil>

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@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2010-07-27 16:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 19:34 [PATCH 1/2] SELinux: allow userspace to read policy back out of the kernel Eric Paris
2010-07-26 19:34 ` [PATCH 2/2] selinux: implement mmap on /selinux/policy Eric Paris
2010-07-27 16:47   ` Stephen Smalley
2010-07-27 16:50     ` Eric Paris [this message]
2010-07-27 18:36   ` Stephen Smalley
2010-07-27 18:51     ` Eric Paris
2010-07-27 19:09       ` Stephen Smalley
2010-07-27 19:16         ` Eric Paris
2010-07-27 19:20           ` Stephen Smalley
2010-07-27 19:24             ` Eric Paris
2010-07-27 19:28               ` Stephen Smalley
2010-07-27 20:24                 ` Eric Paris
2010-07-29 12:50                   ` Stephen Smalley
2010-07-29 17:58                     ` Eric Paris
2010-07-26 20:48 ` [PATCH 1/2] SELinux: allow userspace to read policy back out of the kernel Stephen Smalley
2010-07-27 18:11   ` Eric Paris
2010-07-27 18:39     ` Stephen Smalley
2010-10-13 13:20       ` Eric Paris
2010-10-13 14:17         ` Eric Paris
2010-10-13 19:15           ` Eric Paris
2010-07-27 18:31 ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1280249431.23427.126.camel@localhost \
    --to=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.