Bug 282575 - linux jail: setting S_ISGID on directory should be ignored
Summary: linux jail: setting S_ISGID on directory should be ignored
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.4-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-05 22:27 UTC by Joerg Wunsch
Modified: 2024-11-12 15:59 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Wunsch freebsd_committer freebsd_triage 2024-11-05 22:27:43 UTC
Running an installer of a large software (Intel Modelsim), it tries to set the S_ISGID on many of the directories it is going to install. On Linux, this bit causes BSD semantics for files created within such a directory (i.e. the group is inherited from the directory rather than from the process creating it).

Currently, attempting to set S_ISGID from within a (Linux?) jail causes an EPERM. As the desired behaviour (inherit group membership for new files) is the BSD behaviour anyway, it makes most sense to simply ignore this bit from within a jail, rather than triggering an error.
Comment 1 Emily 2024-11-10 11:27:30 UTC
MARKED AS SPAM
Comment 2 Ed Maste freebsd_committer freebsd_triage 2024-11-10 16:35:54 UTC
cy@ has an informative post on the history: https://forums.FreeBSD.org/threads/sgid-on-directories.70392/post-612829

The proposed change seems appropriate. It looks like this could be addressed (limited to Linux binaries) by passing a flag to kern_fchmodat from linux_chmod / linux_fchmodat to ignore S_ISGID.