Skip to content

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

Open
lkundrak wants to merge 1 commit intoMitchBradley:masterfrom
lkundrak:lr/sysio-permissions
Open

kernel/sysio: don't default to all-ones permissions#17
lkundrak wants to merge 1 commit intoMitchBradley:masterfrom
lkundrak:lr/sysio-permissions

Conversation

@lkundrak
Copy link
Copy Markdown
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