Bug 26401 - Regressions in lchmod and fchmodat when /proc is not mounted
Summary: Regressions in lchmod and fchmodat when /proc is not mounted
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.32
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: https://sourceware.org/pipermail/libc...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-17 16:13 UTC by Dmitry V. Levin
Modified: 2022-04-27 13:36 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
ldv: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry V. Levin 2020-08-17 16:13:21 UTC
Fixes for https://sourceware.org/bugzilla/show_bug.cgi?id=14578
introduced regressions in cases when /proc is not mounted:
- lchmod used to return ENOSYS, now it returns EOPNOTSUPP;
- fchmodat(AT_SYMLINK_NOFOLLOW) used to return ENOTSUP, now it returns EOPNOTSUPP which is different from ENOTSUP on some architectures, e.g. hppa.
Comment 1 Alkis Georgopoulos 2020-10-30 07:31:47 UTC
Hello, just noting that rsync in Ubuntu 20.10 is affected by this glibc issue:

https://bugs.launchpad.net/ubuntu/+source/rsync/+bug/1902109
https://github.com/WayneD/rsync/issues/109
Comment 2 Tom Hughes 2020-11-04 11:09:47 UTC
Also rsync in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1894485
Comment 3 Adhemerval Zanella 2022-04-27 12:55:17 UTC
I think there is no much glibc can do without proper kernel support [1].

[1] https://sourceware.org/pipermail/libc-alpha/2020-July/116513.html
Comment 4 Dmitry V. Levin 2022-04-27 13:06:56 UTC
Just letting you know that we reverted commit 6b89c385d8bd0700b25bac2c2d0bebe68d5cc05d in our glibc build shortly after reporting this issue.
Comment 5 Adhemerval Zanella 2022-04-27 13:36:48 UTC
(In reply to Dmitry V. Levin from comment #4)
> Just letting you know that we reverted commit
> 6b89c385d8bd0700b25bac2c2d0bebe68d5cc05d in our glibc build shortly after
> reporting this issue.

Reading rsync bug report, I really think that EOPNOTSUPP is the correct error code to return in this case. The configure was done on a build system where lchmod does work (since it has procps mounted). So I do not fully agree this really characterizes as a regression.

And I don't think reverting lchmod support since propcs might be not available is the correct approach, best option would try to ask kernel to have proper syscall support which does not require userland hacks. Rick Felker already sent a patch, but it seems to be stuck.