Summary: | [Linuxulator]: getxattr EPERM for non-root users inside chroots | ||
---|---|---|---|
Product: | Base System | Reporter: | Joe Mullally <jwmullally> |
Component: | kern | Assignee: | Dmitry Chagin <dchagin> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | dchagin |
Priority: | --- | ||
Version: | 14.0-CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Joe Mullally
2023-09-02 10:16:43 UTC
This has already been fixed by https://cgit.freebsd.org/src/commit/?id=1bfc4574f78653e4b64ac9dd31518c96a17fe52b Will be merged to stable/14 in a week's time Confirmed working without issue on latest FreeBSD 15.0-CURRENT build: root@freebsd15:~ # uname -a FreeBSD freebsd15 15.0-CURRENT FreeBSD 15.0-CURRENT amd64 1500000 #0 main-n265205-03a7c36ddbc0: Thu Sep 7 03:10:34 UTC 2023 root@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 root@freebsd15:~ # debootstrap bullseye debian_build http://deb.debian.org/debian root@freebsd15:~ # chroot debian_build /bin/bash root@freebsd15:/# apt update Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB] Get:2 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB] Get:3 http://deb.debian.org/debian bullseye/main Translation-en [6240 kB] Fetched 14.5 MB in 5s (2821 kB/s) Reading package lists... Done Building dependency tree... Done All packages are up to date. root@freebsd15:/# su someguy someguy@freebsd15:~$ strace cp --preserve=mode hello hello2 2>&1 | grep xattr fgetxattr(3, "system.posix_acl_access", 0x7fffffffbd30, 132) = -1 ENODATA (No data available) fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 28, 0) = -1 EOPNOTSUPP (Operation not supported) +++ exited with 0 +++ A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a9b8a0ced46efe72ec118a749d191b29ce47712b commit a9b8a0ced46efe72ec118a749d191b29ce47712b Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-09-01 08:10:12 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-09-11 11:58:50 +0000 linux(4): Return ENODATA from getxattr syscalls instead of EPERM On Linux ENODATA mean the named attribute does not exist, or the process has no access to this attribute. Reported by: zirias PR: 273517 Tested by: zirias MFC after: 1 week (cherry picked from commit 4d59b790553ef75b9a4b6a673eab3354f3d012b3) sys/compat/linux/linux_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) A commit in branch releng/14.0 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=01d9f0eebf8dceddc465fecac919c1e9d7a586a2 commit 01d9f0eebf8dceddc465fecac919c1e9d7a586a2 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-09-01 08:10:12 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-09-12 16:42:31 +0000 linux(4): Return ENODATA from getxattr syscalls instead of EPERM On Linux ENODATA mean the named attribute does not exist, or the process has no access to this attribute. Approved by: re (gjb) Reported by: zirias PR: 273517 Tested by: zirias MFC after: 1 week (cherry picked from commit 4d59b790553ef75b9a4b6a673eab3354f3d012b3) (cherry picked from commit a9b8a0ced46efe72ec118a749d191b29ce47712b) sys/compat/linux/linux_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) |