lkml.org 
[lkml]   [2020]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.9 52/74] erofs: avoid duplicated permission check for "trusted." xattrs
    Date
    From: Gao Xiang <hsiangkao@redhat.com>

    commit d578b46db69d125a654f509bdc9091d84e924dc8 upstream.

    Don't recheck it since xattr_permission() already
    checks CAP_SYS_ADMIN capability.

    Just follow 5d3ce4f70172 ("f2fs: avoid duplicated permission check for "trusted." xattrs")

    Reported-by: Hongyu Jin <hongyu.jin@unisoc.com>
    [ Gao Xiang: since it could cause some complex Android overlay
    permission issue as well on android-5.4+, it'd be better to
    backport to 5.4+ rather than pure cleanup on mainline. ]
    Cc: <stable@vger.kernel.org> # 5.4+
    Link: https://lore.kernel.org/r/20200811070020.6339-1-hsiangkao@redhat.com
    Reviewed-by: Chao Yu <yuchao0@huawei.com>
    Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/erofs/xattr.c | 2 --
    1 file changed, 2 deletions(-)

    --- a/fs/erofs/xattr.c
    +++ b/fs/erofs/xattr.c
    @@ -473,8 +473,6 @@ static int erofs_xattr_generic_get(const
    return -EOPNOTSUPP;
    break;
    case EROFS_XATTR_INDEX_TRUSTED:
    - if (!capable(CAP_SYS_ADMIN))
    - return -EPERM;
    break;
    case EROFS_XATTR_INDEX_SECURITY:
    break;

    \
     
     \ /
      Last update: 2020-10-31 12:48    [W:4.105 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site