From: Stephen Smalley <sds@tycho.nsa.gov>
To: Laurent Bigonville <bigon@debian.org>, SELinux <selinux@tycho.nsa.gov>
Cc: 786956@bugs.debian.org
Subject: Re: getpidcon() behaviour when other LSM is enabled
Date: Thu, 28 May 2015 14:31:30 -0400 [thread overview]
Message-ID: <55675F02.70201@tycho.nsa.gov> (raw)
In-Reply-To: <20150528200648.6fb9e949@fornost.bigon.be>
On 05/28/2015 02:06 PM, Laurent Bigonville wrote:
> Hello,
>
> In procps(-ng)[0] when the use of libselinux is enabled at build time,
> it always uses getpidcon() even if an other (or no) LSM is enabled.
>
> I tried to use getpidcon() (via the cmd tool getpidcon) with apparmor
> enabled instead of selinux, and it returned the apparmor context.
> Is this expected and can we rely on this?
Fundamentally, getpidcon() just reads the value of
/proc/pid/attr/current into a dynamically allocated buffer and returns
it. That part should work for any security module. The only other
thing getpidcon() does is pass the context to mcstransd for context
translation if mcstransd is running. That could potentially break if
you happen to be running mcstransd on a non-SELinux system, although I
don't know why anyone would. Possibly we ought to have mcstransd test
is_selinux_enabled() and bail immediately if it is disabled just to
preclude that.
> Otherwise, I've prepared the attached patch. Would this patch be
> acceptable?
>
> Cheers,
>
> Laurent Bigonville
>
> [0] https://gitlab.com/procps-ng/procps/blob/master/ps/output.c#L1237
>
>
>
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.
>
prev parent reply other threads:[~2015-05-28 18:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 18:06 getpidcon() behaviour when other LSM is enabled Laurent Bigonville
2015-05-28 18:31 ` 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=55675F02.70201@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=786956@bugs.debian.org \
--cc=bigon@debian.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.