Skip to content
Snippets Groups Projects
Commit 3f62a020 authored by Jeff Vander Stoep's avatar Jeff Vander Stoep Committed by Jeffrey Vander Stoep
Browse files

logd: allow logd to write to /dev/cpuset files

Required by logd on devices with USE_CPUSETS defined.

Make /dev/cpuset/background, /dev/cpuset/foreground and
/dev/cpuset/task writeable by system gid. Add logd to system
group for writing to cpuset files and to root group to avoid
regressions. When dropping privs, also drop supplementary groups.

Bug: 22699101
Change-Id: Icc01769b18b5e1f1649623da8325a8bfabc3a3f0
parent ed2fe57c
No related branches found
No related tags found
No related merge requests found
...@@ -103,6 +103,10 @@ static int drop_privs() { ...@@ -103,6 +103,10 @@ static int drop_privs() {
return -1; return -1;
} }
if (setgroups(0, NULL) == -1) {
return -1;
}
if (setgid(AID_LOGD) != 0) { if (setgid(AID_LOGD) != 0) {
return -1; return -1;
} }
......
...@@ -145,9 +145,9 @@ on init ...@@ -145,9 +145,9 @@ on init
chown system system /dev/cpuset/tasks chown system system /dev/cpuset/tasks
chown system system /dev/cpuset/foreground/tasks chown system system /dev/cpuset/foreground/tasks
chown system system /dev/cpuset/background/tasks chown system system /dev/cpuset/background/tasks
chmod 0644 /dev/cpuset/foreground/tasks chmod 0664 /dev/cpuset/foreground/tasks
chmod 0644 /dev/cpuset/background/tasks chmod 0664 /dev/cpuset/background/tasks
chmod 0644 /dev/cpuset/tasks chmod 0664 /dev/cpuset/tasks
# qtaguid will limit access to specific data based on group memberships. # qtaguid will limit access to specific data based on group memberships.
...@@ -523,6 +523,7 @@ service logd /system/bin/logd ...@@ -523,6 +523,7 @@ service logd /system/bin/logd
socket logd stream 0666 logd logd socket logd stream 0666 logd logd
socket logdr seqpacket 0666 logd logd socket logdr seqpacket 0666 logd logd
socket logdw dgram 0222 logd logd socket logdw dgram 0222 logd logd
group root system
service logd-reinit /system/bin/logd --reinit service logd-reinit /system/bin/logd --reinit
oneshot oneshot
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment