From: "Zhang, Ning A" <ning.a.zhang@intel.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Roberts, William C" <william.c.roberts@intel.com>
Subject: Re: maybe a bug in SELinux: security_context_to_sid_core
Date: Fri, 9 Mar 2018 02:07:56 +0000 [thread overview]
Message-ID: <1520561275.1367.10.camel@intel.com> (raw)
In-Reply-To: <1519800427.32465.22.camel@intel.com>
Hi, Bill
For below SELinux behavior, do you know why.
BR.
Ning.
在 2018-02-28三的 14:47 +0800,Zhang Ning写道:
> Hi,
>
> Before SELinux is initialized, get scontext by secid by using:
>
> security_secctx_to_secid() may return wrong numbe
>
> eg:
> security_secctx_to_secid("devnull", strlen("devnull"), &sid);
>
> sid here will be 1
>
> because:
>
> in security_context_to_sid_core:
>
> ...
> if (!ss_initialized) {
> int i;
>
> for (i = 1; i < SECINITSID_NUM; i++) {
> if (!strcmp(initial_sid_to_string[i],
> scontext)) {
> *sid = i;
> return 0;
> }
> }
> *sid = SECINITSID_KERNEL;
> return 0;
> }
> ...
>
> and SECINITSID_DEVNULL equals to SECINITSID_NUM, and it will never get
> right secid for "devnull".
>
> is this by design or bug?
>
> BR.
> Ning.
prev parent reply other threads:[~2018-03-09 2:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 6:47 maybe a bug in SELinux: security_context_to_sid_core Zhang, Ning A
2018-03-09 2:07 ` Zhang, Ning A [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=1520561275.1367.10.camel@intel.com \
--to=ning.a.zhang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=william.c.roberts@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox