-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
smack: Add DefaultSmackProcessLabel to user.conf and system.conf #23921
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
Conversation
b9ba61e to
03eadf5
Compare
man/systemd-system.conf.xml
Outdated
| for the details.</para> | ||
|
|
||
| <para>If the value is <literal>/</literal> only labels labels specified with <varname>SmackProcessLabel=</para> | ||
| are assigned and the compile-time default is ignored.</listitem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this common in SMACK land, to use / as marker for "unset"? or did you invent this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my invention. According to SMACK documentation
[…] Single character labels using special characters, that being anything other than a letter or digit, are reserved for use by the Smack development team.
but
[…] Smack labels cannot contain unprintable characters, the "/" (slash), the "" (backslash), the "'" (quote) and '"' (double-quote) characters. Smack labels cannot begin with a '-'. This is reserved for special options. […]
Which means we can be sure / won't be used anywhere in SMACK.
Every task on a Smack system is assigned a label. The Smack label
of a process will usually be assigned by the system initialization
mechanism.
Therefore, there is no notion of unset in SMACK. This is going to by purely systemd logic, to use kernel default instead of the compiled in systemd default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but "-" sounds like a safer option then, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation says.
Smack labels cannot begin with a '-'. This is reserved for special options.
I'd rather not use something that is marked as reserved.
b34b354 to
59c6910
Compare
59c6910 to
e6c8911
Compare
e6c8911 to
83b6cfd
Compare
man/systemd-system.conf.xml
Outdated
| unit. See <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> | ||
| for the details.</para> | ||
|
|
||
| <para>If the value is <literal>/</literal> only labels labels specified with <varname>SmackProcessLabel=</varname> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"labels labels"
Also, I'd like to add a comma after <literal>/</literal>.
BTW, as already discussed at #23921 (comment), still I'd lie to use - for disabling the compile-time defaults. As you already commented, normal labels cannot start with '-'. That means we can safely use '-'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'-' is actually used in a special way (see -CIPSO and -DELETE) and I'd like to stay away from it, even if only to avoid confusion (LSM/MAC stuff is complicated enough) between the ways the kernel and systemd use '-'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, can we use ~?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid we can't
Single character labels using special characters, that being anything other than a letter or digit, are reserved for use by the Smack development team.
DefaultSmackProcessLabel tells systemd what label to assign to its child process in case SmackProcessLabel is not set in the service file. By default, when DefaultSmackProcessLabel is not set child processes inherit label from systemd. If DefaultSmackProcessLabel is set to "/" (which is an invalid character for a SMACK label) the DEFAULT_SMACK_PROCESS_LABEL set during compilation is ignored and systemd act as if the option was unset.
83b6cfd to
ca1f6e0
Compare
DefaultSmackProcessLabel tells systemd what label to assign to its child
process in case SmackProcessLabel is not set in the service file. By
default, when DefaultSmackProcessLabel is not set child processes inherit
label from systemd.