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

Commit 7d7e7cdf authored by Ben Fennema's avatar Ben Fennema
Browse files

init: fix type of 2nd argument passed to prctl



prctl(PR_SET_SECUREBITS, ...) expects an unsigned long as its 2nd argument.
Passing in a int64_t happens to work with a 64-bit kernel, but does not
work with a 32-bit kernel.

Bug: 63680332
Test: boot 32-bit kernel; verify services with capabilities can successfully
      set those capabilties
Change-Id: I60250d107a77b54b2e9fe3419b4480b921c7e2f8
Signed-off-by: default avatarBen Fennema <fennema@google.com>
(cherry picked from commit a7243606)
parent 684f4883
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -245,8 +245,8 @@ void Service::SetProcessAttributes() {
    if (capabilities_.any() && uid_) {
        // If Android is running in a container, some securebits might already
        // be locked, so don't change those.
        int64_t securebits = prctl(PR_GET_SECUREBITS);
        if (securebits == -1) {
        unsigned long securebits = prctl(PR_GET_SECUREBITS);
        if (securebits == -1UL) {
            PLOG(FATAL) << "prctl(PR_GET_SECUREBITS) failed for " << name_;
        }
        securebits |= SECBIT_KEEP_CAPS | SECBIT_KEEP_CAPS_LOCKED;