2019-03-22 14:07:04

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] selinux: Make selinux_kernfs_init_security static

From: YueHaibing <[email protected]>

Fix sparse warning:

security/selinux/hooks.c:3389:5: warning:
symbol 'selinux_kernfs_init_security' was not declared. Should it be static?

Signed-off-by: YueHaibing <[email protected]>
---
security/selinux/hooks.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ab4b049..b6e6152 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3386,8 +3386,8 @@ static int selinux_inode_copy_up_xattr(const char *name)

/* kernfs node operations */

-int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
- struct kernfs_node *kn)
+static int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
+ struct kernfs_node *kn)
{
const struct task_security_struct *tsec = current_security();
u32 parent_sid, newsid, clen;
--
2.7.0




2019-03-22 17:47:25

by Ondrej Mosnacek

[permalink] [raw]
Subject: Re: [PATCH -next] selinux: Make selinux_kernfs_init_security static

On Fri, Mar 22, 2019 at 3:04 PM Yue Haibing <[email protected]> wrote:
> From: YueHaibing <[email protected]>
>
> Fix sparse warning:
>
> security/selinux/hooks.c:3389:5: warning:
> symbol 'selinux_kernfs_init_security' was not declared. Should it be static?
>
> Signed-off-by: YueHaibing <[email protected]>

Yup, another trivial mistake on my part...

Acked-by: Ondrej Mosnacek <[email protected]>

Thanks for catching that!

> ---
> security/selinux/hooks.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index ab4b049..b6e6152 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3386,8 +3386,8 @@ static int selinux_inode_copy_up_xattr(const char *name)
>
> /* kernfs node operations */
>
> -int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> - struct kernfs_node *kn)
> +static int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> + struct kernfs_node *kn)
> {
> const struct task_security_struct *tsec = current_security();
> u32 parent_sid, newsid, clen;
> --
> 2.7.0

--
Ondrej Mosnacek <omosnace at redhat dot com>
Software Engineer, Security Technologies
Red Hat, Inc.

2019-03-22 20:05:29

by Paul Moore

[permalink] [raw]
Subject: Re: [PATCH -next] selinux: Make selinux_kernfs_init_security static

On Fri, Mar 22, 2019 at 1:46 PM Ondrej Mosnacek <[email protected]> wrote:
> On Fri, Mar 22, 2019 at 3:04 PM Yue Haibing <[email protected]> wrote:
> > From: YueHaibing <[email protected]>
> >
> > Fix sparse warning:
> >
> > security/selinux/hooks.c:3389:5: warning:
> > symbol 'selinux_kernfs_init_security' was not declared. Should it be static?
> >
> > Signed-off-by: YueHaibing <[email protected]>
>
> Yup, another trivial mistake on my part...
>
> Acked-by: Ondrej Mosnacek <[email protected]>
>
> Thanks for catching that!

Yes, thanks for the patch; I don't always check for static (or
const'ified args) as much as I should when reviewing code. Merged
into selinux/next.

--
paul moore
http://www.paul-moore.com

2019-03-27 15:20:32

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH -next] selinux: Make selinux_kernfs_init_security static


On 3/22/2019 7:34 PM, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> Fix sparse warning:
>
> security/selinux/hooks.c:3389:5: warning:
> symbol 'selinux_kernfs_init_security' was not declared. Should it be static?
>
> Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>

-Mukesh
> ---
> security/selinux/hooks.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index ab4b049..b6e6152 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3386,8 +3386,8 @@ static int selinux_inode_copy_up_xattr(const char *name)
>
> /* kernfs node operations */
>
> -int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> - struct kernfs_node *kn)
> +static int selinux_kernfs_init_security(struct kernfs_node *kn_dir,
> + struct kernfs_node *kn)
> {
> const struct task_security_struct *tsec = current_security();
> u32 parent_sid, newsid, clen;