All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: mthode@mthode.org
Cc: selinux@tycho.nsa.gov
Subject: Re: kernel function to verify rootcontext
Date: Wed, 06 Nov 2013 08:20:08 -0500	[thread overview]
Message-ID: <527A4208.6050605@tycho.nsa.gov> (raw)
In-Reply-To: <5279C0A6.2090703@mthode.org>

On 11/05/2013 11:08 PM, Matthew Thode wrote:
> Is there a kernel function used to verify that a rootcontext is valid
> (exists and/or is formatted correctly).
> 

Not sure what you mean.  SELinux directly handles and consumes the
rootcontext= and other related mount options before they are passed
along to the filesystem code, so your filesystem doesn't need to do
anything with it.

security_context_to_sid() is the SELinux kernel function for validating
security contexts and mapping them to a security identifier (SID), but
you shouldn't call that from your filesystem code.

>From userspace, you can check a context by writing the context string to
/sys/fs/selinux/context or by calling the libselinux
security_check_context() function (which internally does the same thing)
and checking the result.




--
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:[~2013-11-06 13:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06  4:08 kernel function to verify rootcontext Matthew Thode
2013-11-06 13:20 ` Stephen Smalley [this message]

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=527A4208.6050605@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=mthode@mthode.org \
    --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.