From: Stephen Smalley <sds@tycho.nsa.gov>
To: Andreas Gruenbacher <agruenba@redhat.com>,
linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov
Subject: Re: [PATCH v4 2/7] security: Make inode argument of inode_getsecurity non-const
Date: Thu, 29 Oct 2015 11:03:09 -0400 [thread overview]
Message-ID: <5632352D.60809@tycho.nsa.gov> (raw)
In-Reply-To: <1446079635-22462-3-git-send-email-agruenba@redhat.com>
On 10/28/2015 08:47 PM, Andreas Gruenbacher wrote:
> Make the inode argument of the inode_getsecurity hook non-const so that
> we can use it to revalidate invalid security labels.
>
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
> ---
> include/linux/lsm_hooks.h | 2 +-
> include/linux/security.h | 4 ++--
> security/security.c | 2 +-
> security/selinux/hooks.c | 2 +-
> security/smack/smack_lsm.c | 2 +-
> 5 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
> index ec3a6ba..bdd0a3a 100644
> --- a/include/linux/lsm_hooks.h
> +++ b/include/linux/lsm_hooks.h
> @@ -1413,7 +1413,7 @@ union security_list_options {
> int (*inode_removexattr)(struct dentry *dentry, const char *name);
> int (*inode_need_killpriv)(struct dentry *dentry);
> int (*inode_killpriv)(struct dentry *dentry);
> - int (*inode_getsecurity)(const struct inode *inode, const char *name,
> + int (*inode_getsecurity)(struct inode *inode, const char *name,
> void **buffer, bool alloc);
> int (*inode_setsecurity)(struct inode *inode, const char *name,
> const void *value, size_t size,
> diff --git a/include/linux/security.h b/include/linux/security.h
> index 2f4c1f7..9ee61b2 100644
> --- a/include/linux/security.h
> +++ b/include/linux/security.h
> @@ -270,7 +270,7 @@ int security_inode_listxattr(struct dentry *dentry);
> int security_inode_removexattr(struct dentry *dentry, const char *name);
> int security_inode_need_killpriv(struct dentry *dentry);
> int security_inode_killpriv(struct dentry *dentry);
> -int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc);
> +int security_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc);
> int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags);
> int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size);
> void security_inode_getsecid(const struct inode *inode, u32 *secid);
> @@ -719,7 +719,7 @@ static inline int security_inode_killpriv(struct dentry *dentry)
> return cap_inode_killpriv(dentry);
> }
>
> -static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc)
> +static inline int security_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc)
> {
> return -EOPNOTSUPP;
> }
> diff --git a/security/security.c b/security/security.c
> index 46f405c..73514c9 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -697,7 +697,7 @@ int security_inode_killpriv(struct dentry *dentry)
> return call_int_hook(inode_killpriv, 0, dentry);
> }
>
> -int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc)
> +int security_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc)
> {
> if (unlikely(IS_PRIVATE(inode)))
> return -EOPNOTSUPP;
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index fc8f626..adec2e2 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3110,7 +3110,7 @@ static int selinux_inode_removexattr(struct dentry *dentry, const char *name)
> *
> * Permission check is handled by selinux_inode_getxattr hook.
> */
> -static int selinux_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc)
> +static int selinux_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc)
> {
> u32 size;
> int error;
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index 996c889..07d0344 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -1435,7 +1435,7 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name)
> *
> * Returns the size of the attribute or an error code
> */
> -static int smack_inode_getsecurity(const struct inode *inode,
> +static int smack_inode_getsecurity(struct inode *inode,
> const char *name, void **buffer,
> bool alloc)
> {
>
next prev parent reply other threads:[~2015-10-29 15:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-29 0:47 [PATCH v4 0/7] Inode security label invalidation Andreas Gruenbacher
2015-10-29 0:47 ` [PATCH v4 1/7] selinux: Remove unused variable in selinux_inode_init_security Andreas Gruenbacher
2015-10-29 0:47 ` [PATCH v4 2/7] security: Make inode argument of inode_getsecurity non-const Andreas Gruenbacher
2015-10-29 15:03 ` Stephen Smalley [this message]
2015-10-29 0:47 ` [PATCH v4 3/7] security: Make inode argument of inode_getsecid non-const Andreas Gruenbacher
2015-10-29 15:04 ` Stephen Smalley
2015-10-29 0:47 ` [PATCH v4 4/7] selinux: Add accessor functions for inode->i_security Andreas Gruenbacher
2015-10-29 15:08 ` Stephen Smalley
2015-10-29 0:47 ` [PATCH v4 5/7] security: Add hook to invalidate inode security labels Andreas Gruenbacher
2015-10-29 15:12 ` Stephen Smalley
2015-10-29 0:47 ` [PATCH v4 6/7] selinux: Revalidate invalid " Andreas Gruenbacher
2015-10-29 15:21 ` Stephen Smalley
2015-10-29 16:52 ` Andreas Gruenbacher
2015-11-01 12:52 ` Paul Moore
2015-11-01 17:25 ` Andreas Gruenbacher
2015-10-29 23:09 ` Andreas Gruenbacher
2015-10-29 0:47 ` [Cluster-devel] [PATCH v4 7/7] gfs2: Invalide security labels of inodes when they go invalid Andreas Gruenbacher
2015-10-29 0:47 ` Andreas Gruenbacher
2015-10-29 12:10 ` [Cluster-devel] " Bob Peterson
2015-10-29 12:10 ` Bob Peterson
2015-10-30 11:51 ` [Cluster-devel] " Steven Whitehouse
2015-10-30 11:51 ` Steven Whitehouse
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=5632352D.60809@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=agruenba@redhat.com \
--cc=linux-security-module@vger.kernel.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.