2019-03-04 13:29:53

by Russell Coker

[permalink] [raw]
Subject: strange daemon startup issue

When I boot kernel 4.9.144 (Debian/Stable kernel) with the Debian policy for
Unstable (which isn't very different to the latest Git refpolicy) /usr/sbin/
ModemManager and /usr/sbin/mysqld run as init_t.

When I boot the same policy with kernel 4.19.16 (Debian/Testing kernel) those
daemons run in modemmanager_t and mysqld_t as desired.

What is the difference between those kernels which would explain this? Would
it be some interaction with systemd? I don't expect anyone to just hand me
the answer (although that would be really nice), any clues as to where I
should start investigating this would be great.

The general aim with Debian SE Linux is that you can run the policy with the
kernel from the previous version of Debian. So this is something I really
want to fix.

--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/



2019-03-04 13:35:00

by Dominick Grift

[permalink] [raw]
Subject: Re: strange daemon startup issue

Russell Coker <[email protected]> writes:

> When I boot kernel 4.9.144 (Debian/Stable kernel) with the Debian policy for
> Unstable (which isn't very different to the latest Git refpolicy) /usr/sbin/
> ModemManager and /usr/sbin/mysqld run as init_t.
>
> When I boot the same policy with kernel 4.19.16 (Debian/Testing kernel) those
> daemons run in modemmanager_t and mysqld_t as desired.
>
> What is the difference between those kernels which would explain this? Would
> it be some interaction with systemd? I don't expect anyone to just hand me
> the answer (although that would be really nice), any clues as to where I
> should start investigating this would be great.
>
> The general aim with Debian SE Linux is that you can run the policy with the
> kernel from the previous version of Debian. So this is something I really
> want to fix.

Could it be the nnp_nosuid_transition polcap? Not sure when that was
exactly introduced but that change does affect domain transitions.

--
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

2019-03-04 13:59:56

by Dominick Grift

[permalink] [raw]
Subject: Re: strange daemon startup issue

On Tue, Mar 05, 2019 at 12:29:45AM +1100, Russell Coker wrote:
> When I boot kernel 4.9.144 (Debian/Stable kernel) with the Debian policy for
> Unstable (which isn't very different to the latest Git refpolicy) /usr/sbin/
> ModemManager and /usr/sbin/mysqld run as init_t.
>
> When I boot the same policy with kernel 4.19.16 (Debian/Testing kernel) those
> daemons run in modemmanager_t and mysqld_t as desired.
>
> What is the difference between those kernels which would explain this? Would
> it be some interaction with systemd? I don't expect anyone to just hand me
> the answer (although that would be really nice), any clues as to where I
> should start investigating this would be great.
>
> The general aim with Debian SE Linux is that you can run the policy with the
> kernel from the previous version of Debian. So this is something I really
> want to fix.

If its the nnp transition polcap then you have some options:

1. easiest is to remove the references to "NoNewPrivileges=" in systemd service units. Hopefully in these old versions of systemd this directive is not implied by other widely used directives.
I recall that back then I got away with this solution, at least untill the polcap was introduced.

2. hard and ugly: before the polcap was introduced, NNP was covered with type bounds. (see selinux_err messages on older kernels)
This can get ugly really fast though as the NNP flag is inherited. Probably best to avoid this option, but in theory it is possible to address this issue with type bounds.

>
> --
> My Main Blog http://etbe.coker.com.au/
> My Documents Blog http://doc.coker.com.au/
>

--
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift


Attachments:
(No filename) (1.76 kB)
signature.asc (659.00 B)
Download all attachments