All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] erofs: avoid duplicated permission check for "trusted." xattrs
@ 2020-08-11  7:00 ` Gao Xiang
  0 siblings, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2020-08-11  7:00 UTC (permalink / raw)
  To: linux-erofs, Chao Yu; +Cc: LKML, Chao Yu, Hongyu Jin, Gao Xiang, stable

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+, so it'd be better to
  backport to 5.4+ rather than pure cleanup on mainline. ]
Cc: <stable@vger.kernel.org> # 5.4+
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
---
related commit:
https://android-review.googlesource.com/c/kernel/common/+/1121623/6/fs/xattr.c#b284

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

diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c
index 87e437e7b34f..f86e3247febc 100644
--- a/fs/erofs/xattr.c
+++ b/fs/erofs/xattr.c
@@ -473,8 +473,6 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler,
 			return -EOPNOTSUPP;
 		break;
 	case EROFS_XATTR_INDEX_TRUSTED:
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
 		break;
 	case EROFS_XATTR_INDEX_SECURITY:
 		break;
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] erofs: avoid duplicated permission check for "trusted." xattrs
@ 2020-08-11  7:00 ` Gao Xiang
  0 siblings, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2020-08-11  7:00 UTC (permalink / raw)
  To: linux-erofs, Chao Yu; +Cc: Hongyu Jin, LKML, stable

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+, so it'd be better to
  backport to 5.4+ rather than pure cleanup on mainline. ]
Cc: <stable@vger.kernel.org> # 5.4+
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
---
related commit:
https://android-review.googlesource.com/c/kernel/common/+/1121623/6/fs/xattr.c#b284

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

diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c
index 87e437e7b34f..f86e3247febc 100644
--- a/fs/erofs/xattr.c
+++ b/fs/erofs/xattr.c
@@ -473,8 +473,6 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler,
 			return -EOPNOTSUPP;
 		break;
 	case EROFS_XATTR_INDEX_TRUSTED:
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
 		break;
 	case EROFS_XATTR_INDEX_SECURITY:
 		break;
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] erofs: avoid duplicated permission check for "trusted." xattrs
  2020-08-11  7:00 ` Gao Xiang
@ 2020-08-12  2:01   ` Chao Yu
  -1 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2020-08-12  2:01 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs; +Cc: LKML, Chao Yu, Hongyu Jin, stable

On 2020/8/11 15:00, Gao Xiang wrote:
> 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+, so it'd be better to
>    backport to 5.4+ rather than pure cleanup on mainline. ]
> Cc: <stable@vger.kernel.org> # 5.4+
> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] erofs: avoid duplicated permission check for "trusted." xattrs
@ 2020-08-12  2:01   ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2020-08-12  2:01 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs; +Cc: Hongyu Jin, LKML, stable

On 2020/8/11 15:00, Gao Xiang wrote:
> 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+, so it'd be better to
>    backport to 5.4+ rather than pure cleanup on mainline. ]
> Cc: <stable@vger.kernel.org> # 5.4+
> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-12  2:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11  7:00 [PATCH] erofs: avoid duplicated permission check for "trusted." xattrs Gao Xiang
2020-08-11  7:00 ` Gao Xiang
2020-08-12  2:01 ` Chao Yu
2020-08-12  2:01   ` Chao Yu

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.