logd: use SO_PEERGROUPS when appropriate

Logd checks all supplemental groups of a peer socket to see if it may
have privileges to read logs.  This was previously done by a racy
checking of /proc/<pid>/status, but this can now be replaced by
SO_PEERGROUPS for kernels 4.13+.

Test: SO_PEERGROUPS is successful on CF
Test: non-root,system,log groups cannot read logs still
Test: new test that does the above check
Change-Id: I71f96f7acaf105e836f8fc4fee0ecb96e92242b4
2 files changed
tree: 5bd6204fd485e36a0b8e0fc0f898a6242ebaff84
  1. liblog/
  2. logcat/
  3. logd/
  4. logwrapper/
  5. OWNERS
  6. PREUPLOAD.cfg
  7. TEST_MAPPING