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

Commit 83ff1049 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes from topic "uid_pid with recovery mode" am: 0130a782

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1585103

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idac79861c7f119f7afabbb71545a97807dc51f96
parents 3067ef3e 0130a782
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -421,14 +421,27 @@ int killProcessGroupOnce(uid_t uid, int initialPid, int signal, int* max_process
static int createProcessGroupInternal(uid_t uid, int initialPid, std::string cgroup) {
    auto uid_path = ConvertUidToPath(cgroup.c_str(), uid);

    if (!MkdirAndChown(uid_path, 0750, AID_SYSTEM, AID_SYSTEM)) {
    struct stat cgroup_stat;
    mode_t cgroup_mode = 0750;
    gid_t cgroup_uid = AID_SYSTEM;
    uid_t cgroup_gid = AID_SYSTEM;

    if (stat(cgroup.c_str(), &cgroup_stat) == 1) {
        PLOG(ERROR) << "Failed to get stats for " << cgroup;
    } else {
        cgroup_mode = cgroup_stat.st_mode;
        cgroup_uid = cgroup_stat.st_uid;
        cgroup_gid = cgroup_stat.st_gid;
    }

    if (!MkdirAndChown(uid_path, cgroup_mode, cgroup_uid, cgroup_gid)) {
        PLOG(ERROR) << "Failed to make and chown " << uid_path;
        return -errno;
    }

    auto uid_pid_path = ConvertUidPidToPath(cgroup.c_str(), uid, initialPid);

    if (!MkdirAndChown(uid_pid_path, 0750, AID_SYSTEM, AID_SYSTEM)) {
    if (!MkdirAndChown(uid_pid_path, cgroup_mode, cgroup_uid, cgroup_gid)) {
        PLOG(ERROR) << "Failed to make and chown " << uid_pid_path;
        return -errno;
    }
+6 −0
Original line number Diff line number Diff line
{
  "Cgroups2": {
    "Path": "/sys/fs/cgroup",
    "Mode": "0755",
    "UID": "root",
    "GID": "root"
  }
}