#2564 selinux_child needs to setuid(0) to make libselinux work as non-root
Closed: Fixed None Opened 8 years ago by jhrozek.

libselinux uses many access(2) calls and as Sumit educated me, access uses the real UID, not the effective UID for the check. Therefore, the setuid selinux_child, which only has effective UID of root would fail the check.

Calling setuid(0) seems to set also the real UID, we should do that in the selinux child for the duration of the semanage transaction.

(Why does libselinux call access() instead of gracefully failing open() is a mystery to me..seems like a toctou race, but we need to work around it)

Fields changed

owner: somebody => jhrozek
priority: major => blocker
status: new => assigned

This ticket was requested by a downstream. I'm bypassing the triage and moving to 1.12.4

milestone: NEEDS_TRIAGE => SSSD 1.12.4
patch: 0 => 1

resolution: => fixed
status: assigned => closed

Metadata Update from @jhrozek:
- Issue assigned to jhrozek
- Issue set to the milestone: SSSD 1.12.4

5 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/3606

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.