From: Paul Moore <paul@paul-moore.com>
To: Mark Salyzyn <salyzyn@android.com>
Cc: linux-kernel@vger.kernel.org, Stephen Smalley <sds@tycho.nsa.gov>,
Eric Paris <eparis@parisplace.org>,
James Morris <james.l.morris@oracle.com>,
"Serge E. Hallyn" <serge@hallyn.com>,
selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org
Subject: Re: [PATCH 5/5] pstore: selinux: add security in-core xattr support for pstore and debugfs
Date: Wed, 14 Jan 2015 14:50:01 -0500 [thread overview]
Message-ID: <4175437.ksvLooJb8o@sifl> (raw)
In-Reply-To: <1421188410-2006-1-git-send-email-salyzyn@android.com>
On Tuesday, January 13, 2015 02:33:18 PM Mark Salyzyn wrote:
> - add "pstore" and "debugfs" to list of in-core exceptions
> - change fstype checks to boolean equation
> - change from strncmp to strcmp for checking
>
> Signed-off-by: Mark Salyzyn <salyzyn@android.com>
> ---
> security/selinux/hooks.c | 25 ++++++++-----------------
> 1 file changed, 8 insertions(+), 17 deletions(-)
Not a huge fan of the coding style, but merged into the next branch
regardless.
Thanks.
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 6da7532..789a7e1 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -401,23 +401,14 @@ static int selinux_is_sblabel_mnt(struct super_block
> *sb) {
> struct superblock_security_struct *sbsec = sb->s_security;
>
> - if (sbsec->behavior == SECURITY_FS_USE_XATTR ||
> - sbsec->behavior == SECURITY_FS_USE_TRANS ||
> - sbsec->behavior == SECURITY_FS_USE_TASK)
> - return 1;
> -
> - /* Special handling for sysfs. Is genfs but also has setxattr handler*/
> - if (strncmp(sb->s_type->name, "sysfs", sizeof("sysfs")) == 0)
> - return 1;
> -
> - /*
> - * Special handling for rootfs. Is genfs but supports
> - * setting SELinux context on in-core inodes.
> - */
> - if (strncmp(sb->s_type->name, "rootfs", sizeof("rootfs")) == 0)
> - return 1;
> -
> - return 0;
> + return sbsec->behavior == SECURITY_FS_USE_XATTR ||
> + sbsec->behavior == SECURITY_FS_USE_TRANS ||
> + sbsec->behavior == SECURITY_FS_USE_TASK ||
> + /* Special handling. Genfs but also in-core setxattr handler */
> + !strcmp(sb->s_type->name, "sysfs") ||
> + !strcmp(sb->s_type->name, "pstore") ||
> + !strcmp(sb->s_type->name, "debugfs") ||
> + !strcmp(sb->s_type->name, "rootfs");
> }
>
> static int sb_finish_set_opts(struct super_block *sb)
--
paul moore
www.paul-moore.com
prev parent reply other threads:[~2015-01-14 19:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 22:33 Mark Salyzyn
2015-01-14 15:49 ` Stephen Smalley
2015-01-14 19:50 ` Paul Moore [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=4175437.ksvLooJb8o@sifl \
--to=paul@paul-moore.com \
--cc=eparis@parisplace.org \
--cc=james.l.morris@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=salyzyn@android.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=serge@hallyn.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
all inboxes | Powered by JetHome®