Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 937935 - selinux userland 3.7 causes segfaults with mls (in combination with pam_mktemp) in su, and agetty(?)
Summary: selinux userland 3.7 causes segfaults with mls (in combination with pam_mktem...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal critical
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-14 21:55 UTC by tz022k+cryij97ex1ip0
Modified: 2024-08-26 15:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Trimmed --info (einfon.txt,6.02 KB, text/plain)
2024-08-14 22:13 UTC, tz022k+cryij97ex1ip0
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tz022k+cryij97ex1ip0 2024-08-14 21:55:49 UTC
After upgrading from 3.6*, su and (presumably) agetty segfault with mls policy. Presumably ~arch is not testing this combination. One hopes that at least strict is tested for with CI.

Booting in permissive shows denials for { open read search } tmp_t and { getattr setattr } user_tmp_t, as well as getty_t self : capability2 checkpoint_restore (policy was already up to date, though the problem emerged earlier with userland upgraded first, IIRC.)

3.6* does not segfault and logs in (sysadm_t) successfully. I should expect policy errors not to result in a segfault with 3.7*.

Note that this user uses ephemeral VMs so disentangling the cause to a deterministic reproducer for a mere user is close to magic(!) so I would appreciate if devs could help reproduce.
Comment 1 tz022k+cryij97ex1ip0 2024-08-14 22:13:59 UTC
Created attachment 900170 [details]
Trimmed --info

Note that this user tried compiling selinux userland update with default LDFLAGS (Wl,--as-needed) and -march=native -O2 -pipe help 'reduce'.
Comment 2 tz022k+cryij97ex1ip0 2024-08-14 22:16:42 UTC
> Note that this user tried compiling selinux userland update with default LDFLAGS (Wl,--as-needed) and -march=native -O2 -pipe help 'reduce'.

should read as 

> Note that this user tried compiling selinux userland update with default LDFLAGS (Wl,--as-needed) and -march=native -O2 -pipe to help 'reduce'.

Sorry for the bugspam.
Comment 3 Kenton Groombridge gentoo-dev 2024-08-15 15:07:26 UTC
Does booting into permissive with userland 3.7 allow the system to function? Could you please provide the full AVCs for those denials that you are seeing?

I'm going to set up a VM to test this and see if I can reproduce it, but my initial hunch is that this isn't specifically related to the MLS policy.
Comment 4 tzt8nd+24uuil6at9s2o 2024-08-26 14:37:56 UTC
(In reply to Kenton Groombridge from comment #3)
> Does booting into permissive with userland 3.7 allow the system to function?
Yes, hence finding the denials.

Note that instead of .private being created tmp_t, it is created as login_tmp_t, and restorecon is necessary (systemd_tmpfiles has mls restrictions on creating tmp_t so only solution there is to restorecon as sysadm_t). Hazily IIRC that is not the case in permissive boot.

>Could you please provide the full AVCs for those denials that you are seeing?
That would be very difficult at the moment. It requires redoing the changes, applying them to the base template and booting a ephemeral VM. Perhaps a stupid setup, but I hadn't considered these contingencies and it had worked up until now =/

I seriously had/have given up, hence the initial reporting and delay.

> I'm going to set up a VM to test this and see if I can reproduce it, but my
> initial hunch is that this isn't specifically related to the MLS policy.
I would very much appreciate that.

Note that bugzilla prompted me to enter an email address after entering the previous one, so I had to make another account. Sorry--I can only speculate that it's due to the '+'.