Commit c40c54e6 authored by Tatsuyuki Ishi's avatar Tatsuyuki Ishi Committed by Sandeep Dhavale
Browse files

UPSTREAM: erofs: impersonate the opener's credentials when accessing backing file



Previously, file operations on a file-backed mount used the current
process' credentials to access the backing FD. Attempting to do so on
Android lead to SELinux denials, as ACL rules on the backing file (e.g.
/system/apex/foo.apex) is restricted to a small set of process.
Arguably, this error is redundant and leaking implementation details, as
access to files on a mount is already ACL'ed by path.

Instead, override to use the opener's cred when accessing the backing
file. This makes the behavior similar to a loop-backed mount, which
uses kworker cred when accessing the backing file and does not cause
SELinux denials.

Signed-off-by: default avatarTatsuyuki Ishi <ishitatsuyuki@google.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: default avatarHongbo Li <lihongbo22@huawei.com>
Link: https://lore.kernel.org/r/20250612-b4-erofs-impersonate-v1-1-8ea7d6f65171@google.com


Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>

Bug: 428292438
Change-Id: I1c3f08326ae1e6ba0bcaac1f9afb336645f8b065
(cherry picked from commit 905eeb2b)
Signed-off-by: default avatarWang Shuai <wangshuai12@xiaomi.corp-partner.google.com>
parent 4d0200d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment