Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e1f8dd8f authored by Alan Stokes's avatar Alan Stokes
Browse files

Set CLOEXEC on socket inherited from init

The control sockets a service inherits when spawned from init cannot
have O_CLOEXEC set, or they wouldn't be inherited.

But we don't want them to be further inherited when we are running an
RPC binder server on them, so set the flag.

This showed up in authfs_service, which inherits a socket and spawns
an authfs process, leading to a denial like this (since authfs doesn't
have the SELinux permission to access the socket):

avc: denied { read write } for pid=207 comm="authfs"
path="socket:[6436]" dev="sockfs" ino=6436 scontext=u:r:authfs:s0
tcontext=u:r:authfs_service:s0 tclass=unix_stream_socket permissive=0

The denial is harmless, but it can easily be interpreted as a sign of
a real problem.

Bug: 264496291
Test: composd_cmd --test-compile; denial no longer seen
Change-Id: I516eb07776eb78db046bc4155315cb8267cfe456
parent a715e0cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment