#2564 selinux_child needs to setuid(0) to make libselinux work as non-root
Closed: Fixed None Opened 4 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

2 years ago

Login to comment on this ticket.

Metadata