Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel/sysio: don't default to all-ones permissions #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lkundrak
Copy link
Contributor

The file-protection variable is understood to be an (unsigned) UNIX file mode everywhere, and contrary to what the comment says the -1 is not a default of any sort.

In fact, such a file mode is a pretty terrible thing, because the files end up being setuid executables. That is -- anyone could execute them with the privileges of whoever run the build. It's a matter of luck that umask typically chops off the writable bits and the images generated during the build are likely to just terminate upon an attempt to execute them.

This calls for wisdom: let's use what the UNIX programs typically use for mode bits, for it is the number of a regular non-executable file, and this number is 666, octal.

(Cherry picked from 8577d30 in quozl/openfirmware/)

The file-protection variable is understood to be an (unsigned) UNIX file
mode everywhere, and contrary to what the comment says the -1 is not a
default of any sort.

In fact, such a file mode is a pretty terrible thing, because the files
end up being setuid executables. That is -- anyone could execute them
with the privileges of whoever run the build. It's a matter of luck that
umask typically chops off the writable bits and the images generated
during the build are likely to just terminate upon an attempt to execute
them.

This calls for wisdom: let's use what the UNIX programs typically use for
mode bits, for it is the number of a regular non-executable file, and this
number is 666, octal.

(Cherry picked from 8577d30 in quozl/openfirmware/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant