summaryrefslogtreecommitdiff
path: root/libs/binder/BackendUnifiedServiceManager.cpp
diff options
context:
space:
mode:
author Abhishek Gadewar <abhishekgadewar@meta.com> 2024-09-23 23:22:45 -0700
committer Abhishek Gadewar <abhishekgadewar@meta.com> 2024-10-14 21:51:25 +0000
commiteef06fd87d86a0930fe574ce52fa4f4937127234 (patch)
tree5e4dca234e3bf3d95490c2e0ea4e3318c1f3507b /libs/binder/BackendUnifiedServiceManager.cpp
parentd66c39a29d5cd7848696ed57254084869c9cee2f (diff)
dumpstate: fix retention of CAP_SYSLOG after dropping root
Summary: Prior to dumping, dumpstate drops its root privileges.It sets its "keep capabilities" flag via PR_SET_KEEPCAPS in an attempt to maintain CAP_SYSLOG if the capability was present before dropping root. However, the "keep capabilities" flag applies to the permitted set, not the effective set. The effective set is cleared after a UID change regardless of the flag. See: https://linux.die.net/man/2/prctl Thus, the presence check should be done against the permitted set instead. This change is needed so that dumpstate has the capability required to directly read the kernel buffer,in order to add the ability to perform a dmesg dump. Test: adb shell mkdir /data/nativetest64 mmm -j frameworks/native/cmds/dumpstate/ && adb push ${OUT}/data/nativetest64/dumpstate_* /data/nativetest64 && adb shell /data/nativetest64/dumpstate_test/dumpstate_test && stack Change-Id: I521ee146a46fe1495e46343de0c9c45ffcf9ea5e Signed-off-by: Abhishek Gadewar <abhishekgadewar@meta.com>
Diffstat (limited to 'libs/binder/BackendUnifiedServiceManager.cpp')
0 files changed, 0 insertions, 0 deletions