Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1484967

Re: [PATCH 10/12] posix_acl: don't ignore return value of posix_acl_create_masq()

From Andreas Grünbacher <andreas.gruenbacher@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 10/12] posix_acl: don't ignore return value of posix_acl_create_masq()
Date 2016-09-16 14:50 +0200
Message-ID <si0KB-4Md-19@gated-at.bofh.it> (permalink)
References <si0hz-4BJ-1@gated-at.bofh.it> <si0rf-4Fp-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-09-16 14:19 GMT+02:00 Miklos Szeredi <mszeredi@redhat.com>:
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> Cc: Andreas Gruenbacher <agruenba@redhat.com>
> ---
>  fs/posix_acl.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/fs/posix_acl.c b/fs/posix_acl.c
> index 59d47ab0791a..ea3eb6f3bf1e 100644
> --- a/fs/posix_acl.c
> +++ b/fs/posix_acl.c
> @@ -598,13 +598,14 @@ posix_acl_create(struct inode *dir, umode_t *mode,
>         if (IS_ERR(p))
>                 return PTR_ERR(p);
>
> +       ret = -ENOMEM;
>         clone = posix_acl_clone(p, GFP_NOFS);
>         if (!clone)
> -               goto no_mem;
> +               goto err_release;
>
>         ret = posix_acl_create_masq(clone, mode);
>         if (ret < 0)
> -               goto no_mem_clone;
> +               goto err_release_clone;
>
>         if (ret == 0)
>                 posix_acl_release(clone);
> @@ -618,11 +619,11 @@ posix_acl_create(struct inode *dir, umode_t *mode,
>
>         return 0;
>
> -no_mem_clone:
> +err_release_clone:
>         posix_acl_release(clone);
> -no_mem:
> +err_release:
>         posix_acl_release(p);
> -       return -ENOMEM;
> +       return ret;
>  }
>  EXPORT_SYMBOL_GPL(posix_acl_create);

Indeed, the return value of posix_acl_create_masq shouldn't be ignored
here. posix_acl_create_masq can still only fail when the default ACL
of the parent directory is corrupted as users are prohibited from
setting invalid default ACLs.

Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/12] misc filesystem patches for 4.9 Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:20 +0200
  [PATCH 10/12] posix_acl: don't ignore return value of posix_acl_create_masq() Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
    Re: [PATCH 10/12] posix_acl: don't ignore return value of posix_acl_create_masq() Andreas Grünbacher <andreas.gruenbacher@gmail.com> - 2016-09-16 14:50 +0200
  [PATCH 01/12] ima: use file_dentry() Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 12/12] vfat: don't use ->d_time Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 05/12] locks: fix file locking on overlayfs Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 08/12] btrfs: use filemap_check_errors() Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 11/12] cifs: don't use ->d_time Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 07/12] vfs: do get_write_access() on upper layer of overlayfs Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 02/12] vfs: move permission checking into notify_change() for utimes(NULL) Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 09/12] f2fs: use filemap_check_errors() Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 03/12] vfs: update ovl inode before relatime check Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
  [PATCH 04/12] fsnotify: support overlayfs Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200
    Re: [PATCH 04/12] fsnotify: support overlayfs Jan Kara <jack@suse.cz> - 2016-09-16 21:10 +0200
      Re: [PATCH 04/12] fsnotify: support overlayfs Amir Goldstein <amir73il@gmail.com> - 2016-09-17 08:30 +0200
  [PATCH 06/12] vfs: make argument of d_real_inode() const Miklos Szeredi <mszeredi@redhat.com> - 2016-09-16 14:30 +0200

csiph-web