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

Skip to content
Commit 147d0470 authored by Nick Kralevich's avatar Nick Kralevich Committed by syphyr
Browse files

SockDiag.cpp: Add O_CLOEXEC to tcpdiag sockets

Add O_CLOEXEC to NETLINK_INET_DIAG sockets. This ensures that the file
descriptors associated with these sockets do not leak across an exec()
boundary. Please see "man 2 open" for a description of why this is
desirable.

Addresses the following SELinux denial:

  avc: denied { read write } for comm="clatd" path="socket:[902062]"
  dev="sockfs" ino=902062 scontext=u:r:clatd:s0 tcontext=u:r:netd:s0
  tclass=netlink_tcpdiag_socket permissive=0

which occurs when netd executes clatd and inadvertantly leaks the file
descriptors to that process.

Test: Android compiles and boots, and no obvious errors
Change-Id: Ic5662fa8df6884e7002a0ec89839fe90abe05574
parent bea94d34
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