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

Commit 500a1179 authored by Chenjie Yu's avatar Chenjie Yu Committed by Android (Google) Code Review
Browse files

Merge "add aid check when writting into logd stats buffer. For now we require aid to be system."

parents e648ec80 ec0c886d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -101,6 +101,14 @@ bool LogListener::onDataAvailable(SocketClient* cli) {
        return false;
    }

    if (header->id == LOG_ID_STATS) {
        // Only accept logging from *ManagerService in system server
        // Will add more later as we see fit.
        if (cred->uid != AID_SYSTEM && cred->gid != AID_SYSTEM) {
            return false;
        }
    }

    // Check credential validity, acquire corrected details if not supplied.
    if (cred->pid == 0) {
        cred->pid = logbuf ? logbuf->tidToPid(header->tid)