Skip to contentSkip to conversation

Rename *_var_run_t to *_runtime_t

RFC Chris PeBenito 2 participants 3 messages Sep 14, 2019 – Sep 17, 2019

lore
Share & tools
lore
#0 lore raw

/var/run has moved to /run on most systems and it's use has increased beyond pid files and sockets. Because of this, new types used in /run have for some time followed the convention *_runtime_t. This change would rename all *_var_run_t types to *_runtime_t.

Since this adds many aliases to the policy, the patch set also drops all old backwards-compatibility aliases.

https://github.com/SELinuxProject/refpolicy/pull/106

Any objections to this?

Signature · 1 line
Chris PeBenito
#1 lore raw
Quoted 6 lines · Chris PeBenito

/var/run has moved to /run on most systems and it's use has increased beyond pid files and sockets. Because of this, new types used in /run have for some time followed the convention *_runtime_t. This change would rename all *_var_run_t types to *_runtime_t.

Quoted 6 lines

Since this adds many aliases to the policy, the patch set also drops all old backwards-compatibility aliases.

https://github.com/SELinuxProject/refpolicy/pull/106

Any objections to this?

Hello,
I agree with this change.

When I loaded the policy with your patch on my test system, my kernel logs issued a warning:

SELinux:  Context sysadm_u:sysadm_r:samba_net_t became invalid (unmapped).
SELinux:  Context sysadm_u:sysadm_r:smbcontrol_t became invalid (unmapped).
SELinux:  Context sysadm_u:sysadm_r:winbind_helper_t became invalid (unmapped).

This is because the following optional block from sysadm.te is now dropped:

optional_policy(`
samba_admin(sysadm_t, sysadm_r)
samba_run_smbcontrol(sysadm_t, sysadm_r)
samba_run_smbmount(sysadm_t, sysadm_r)
samba_run_net(sysadm_t, sysadm_r)
samba_run_winbind_helper(sysadm_t, sysadm_r)
')

This block is dropped because it required two types that are not
defined: nmbd_runtime_t and smbd_runtime_t.

In the current refpolicy (git master), there is:

typealias samba_var_run_t alias { nmbd_var_run_t smbd_var_run_t };

Your pull request changes this to:

typealias samba_runtime_t alias { nmbd_var_run_t smbd_var_run_t };

Should nmbd_runtime_t and smbd_runtime_t be changed to samba_runtime_t in interface samba_admin()?
Other than that, I did not find other issues.

Thanks,
Nicolas

#2 lore raw
Quoted 39 lines · Nicolas Iooss
Quoted 6 lines · Chris PeBenito

/var/run has moved to /run on most systems and it's use has increased beyond pid files and sockets. Because of this, new types used in /run have for some time followed the convention *_runtime_t. This change would rename all *_var_run_t types to *_runtime_t.

Quoted 6 lines

Since this adds many aliases to the policy, the patch set also drops all old backwards-compatibility aliases.

https://github.com/SELinuxProject/refpolicy/pull/106

Any objections to this?

Hello,
I agree with this change.

When I loaded the policy with your patch on my test system, my kernel logs issued a warning:

SELinux:  Context sysadm_u:sysadm_r:samba_net_t became invalid (unmapped).
SELinux:  Context sysadm_u:sysadm_r:smbcontrol_t became invalid (unmapped).
SELinux:  Context sysadm_u:sysadm_r:winbind_helper_t became invalid (unmapped).

This is because the following optional block from sysadm.te is now dropped:

optional_policy(`
samba_admin(sysadm_t, sysadm_r)
samba_run_smbcontrol(sysadm_t, sysadm_r)
samba_run_smbmount(sysadm_t, sysadm_r)
samba_run_net(sysadm_t, sysadm_r)
samba_run_winbind_helper(sysadm_t, sysadm_r)
')

This block is dropped because it required two types that are not
defined: nmbd_runtime_t and smbd_runtime_t.

In the current refpolicy (git master), there is:

Quoted 8 lines

typealias samba_var_run_t alias { nmbd_var_run_t smbd_var_run_t };

Your pull request changes this to:

typealias samba_runtime_t alias { nmbd_var_run_t smbd_var_run_t };

Should nmbd_runtime_t and smbd_runtime_t be changed to samba_runtime_t in interface samba_admin()?

Yes. There was another interface that also had that issue. I updated the PR to fix it.

Quoted 5 lines

Other than that, I did not find other issues.

Thanks,
Nicolas

Signature · 1 line
Chris PeBenito