diff mbox series

[v1] security/capabilities: remove check for -EINVAL

Message ID 20180822115240.18196-1-christian@brauner.io (mailing list archive)
State New, archived
Headers show
Series [v1] security/capabilities: remove check for -EINVAL | expand

Commit Message

Christian Brauner Aug. 22, 2018, 11:52 a.m. UTC
bprm_caps_from_vfs_caps() never returned -EINVAL so remove the
rc == -EINVAL check.

Signed-off-by: Christian Brauner <christian@brauner.io>
---
v0 -> v1
- non-functional changes:
  adapt commit message to reflect the fact that
  bprm_caps_from_vfs_caps() never actuall returned -EINVAL.
---
 security/commoncap.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Serge Hallyn Aug. 22, 2018, 1:58 p.m. UTC | #1
Quoting Christian Brauner (christian@brauner.io):
> bprm_caps_from_vfs_caps() never returned -EINVAL so remove the
> rc == -EINVAL check.
> 
> Signed-off-by: Christian Brauner <christian@brauner.io>

Thanks.

Reviewed-by: Serge Hallyn <serge@hallyn.com>

> ---
> v0 -> v1
> - non-functional changes:
>   adapt commit message to reflect the fact that
>   bprm_caps_from_vfs_caps() never actuall returned -EINVAL.
> ---
>  security/commoncap.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/security/commoncap.c b/security/commoncap.c
> index f4c33abd9959..6012f0cd8157 100644
> --- a/security/commoncap.c
> +++ b/security/commoncap.c
> @@ -684,9 +684,6 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_f
>  	}
>  
>  	rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap);
> -	if (rc == -EINVAL)
> -		printk(KERN_NOTICE "%s: cap_from_disk returned %d for %s\n",
> -		       __func__, rc, bprm->filename);
>  
>  out:
>  	if (rc)
> -- 
> 2.17.1
James Morris Aug. 23, 2018, 4:48 p.m. UTC | #2
On Wed, 22 Aug 2018, Serge E. Hallyn wrote:

> Quoting Christian Brauner (christian@brauner.io):
> > bprm_caps_from_vfs_caps() never returned -EINVAL so remove the
> > rc == -EINVAL check.
> > 
> > Signed-off-by: Christian Brauner <christian@brauner.io>
> 
> Thanks.
> 
> Reviewed-by: Serge Hallyn <serge@hallyn.com>

Thanks, I'll queue this for post -rc1 next-general.
James Morris Aug. 29, 2018, 4:09 p.m. UTC | #3
On Wed, 22 Aug 2018, Christian Brauner wrote:

> bprm_caps_from_vfs_caps() never returned -EINVAL so remove the
> rc == -EINVAL check.
> 
> Signed-off-by: Christian Brauner <christian@brauner.io>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general
diff mbox series

Patch

diff --git a/security/commoncap.c b/security/commoncap.c
index f4c33abd9959..6012f0cd8157 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -684,9 +684,6 @@  static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_f
 	}
 
 	rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap);
-	if (rc == -EINVAL)
-		printk(KERN_NOTICE "%s: cap_from_disk returned %d for %s\n",
-		       __func__, rc, bprm->filename);
 
 out:
 	if (rc)