From: ramsdell@mitre.org (John D. Ramsdell)
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov, James Morris <jmorris@namei.org>,
Eric Paris <eparis@parisplace.org>
Subject: Re: getfilecon return code
Date: 09 Jul 2007 16:01:44 -0400 [thread overview]
Message-ID: <ogt644tl51z.fsf@oolong.mitre.org> (raw)
In-Reply-To: <1184005840.12430.139.camel@moss-spartans.epoch.ncsc.mil>
Steve,
Thanks for your quick reply.
Stephen Smalley <sds@tycho.nsa.gov> writes:
> On Mon, 2007-07-09 at 14:07 -0400, John D. Ramsdell wrote:
> > ... In fact, I wrote code that freecon'd a context whenever the
> > return value was not -1.
>
> freecon(NULL) is perfectly legal and harmless, like free(NULL), so
> that part is ok.
There is also the case of printing a security context. The getfilecon
program that is part of the libselinux package thinks one can print a
security context if the return code is non-negative, and thus prints:
/proc/sys/kernel/pid_max (null)
If some other program tried to use the second field of this output as
a security context, it could spell trouble.
John
--
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.
prev parent reply other threads:[~2007-07-09 20:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-09 16:45 [patch] libselinux: fix getfilecon handling of zero-length context Stephen Smalley
2007-07-09 16:48 ` Joshua Brindle
2007-07-09 16:50 ` Stephen Smalley
2007-07-09 17:39 ` Joshua Brindle
2007-07-09 18:07 ` getfilecon return code John D. Ramsdell
2007-07-09 18:30 ` Stephen Smalley
2007-07-09 18:42 ` Stephen Smalley
2007-07-09 19:13 ` Joshua Brindle
2007-07-10 12:41 ` Stephen Smalley
2007-07-10 17:49 ` Joshua Brindle
2007-09-12 15:43 ` Stephen Smalley
2007-07-09 20:01 ` John D. Ramsdell [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=ogt644tl51z.fsf@oolong.mitre.org \
--to=ramsdell@mitre.org \
--cc=eparis@parisplace.org \
--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.