From: Stephen Smalley <sds@tycho.nsa.gov>
To: Thomas COUDRAY <amanone@gmail.com>
Cc: jmorris@namei.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, Eric Paris <eparis@parisplace.org>
Subject: Re: lgetxattr()/getxattr() return different values on a file labelled with selinux disabled
Date: Fri, 15 Mar 2013 13:07:00 -0400 [thread overview]
Message-ID: <51435534.3090007@tycho.nsa.gov> (raw)
In-Reply-To: <CABhRnsXJ6RJ1wPDy_Z3cHmx8q9zdOHDRi5cxt-PFMKcYVv7xpA@mail.gmail.com>
On 03/15/2013 11:24 AM, Thomas COUDRAY wrote:
> 2013/3/15 Stephen Smalley <sds@tycho.nsa.gov>:
>> f is truly a regular file and not a symlink pointing to a regular file?
>
> f is a truly regular file.
>
>> before_t and after_t are both defined in the policy?
>
> Only before_t was defined in the policy.
If not defined in policy, then kernel should remap to unlabeled sid
context.
> When I define after_t in the policy, both commands return the same
> label (after_t).
> But I wouldn't expect this to make a difference in the output of both
> commands (as the only visible difference is lgetxattr() vs getxattr())
getxattr security.* results are supplied by the security module rather
than the filesystem to allow the value to be canonicalized. But this
should happen the same for lgetxattr and getxattr; those should only
differ if the file is a symlink.
>> before_t and after_t are not type aliases of each other?
>
> They are not.
>
>> What are the credentials (capabilities and SELinux security
>> context/permissions) of the process running the ls and getfattr commands?
>
> It has unconfined_u:unconfined_r:before_t label with before_t type.
> Same as the file f.
> The process has full SELinux rights on both command and file.
Did it run as root? Does it have :capability2 mac_override permission?
>> Any relevant messages from SELinux in dmesg output?
>
> No avc warnings in dmesg and audit.log. All looks good.
What about SELinux: messages? e.g. SELinux: Context ... is not valid
(left unmapped).
next prev parent reply other threads:[~2013-03-15 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 10:54 lgetxattr()/getxattr() return different values on a file labelled with selinux disabled Thomas COUDRAY
2013-03-15 12:53 ` Stephen Smalley
2013-03-15 15:24 ` Thomas COUDRAY
2013-03-15 17:07 ` Stephen Smalley [this message]
2013-03-25 16:39 ` Thomas COUDRAY
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=51435534.3090007@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=amanone@gmail.com \
--cc=eparis@parisplace.org \
--cc=jmorris@namei.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).