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

Commit 87b30d04 authored by Arve Hjønnevåg's avatar Arve Hjønnevåg
Browse files

Binder: Don't cast directly from a pointer to binder_uintptr_t

When using the 64 bit binder interface from a 32 bit process the
pointer may get sign extended and cause the kernel to fail to read
from it.

Change-Id: I90fcf53880e2aa92e230a9723f9b3f7696170e32
parent 11cfdccf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -921,7 +921,7 @@ status_t IPCThreadState::writeTransactionData(int32_t cmd, uint32_t binderFlags,
        tr.flags |= TF_STATUS_CODE;
        *statusBuffer = err;
        tr.data_size = sizeof(status_t);
        tr.data.ptr.buffer = reinterpret_cast<binder_uintptr_t>(statusBuffer);
        tr.data.ptr.buffer = reinterpret_cast<uintptr_t>(statusBuffer);
        tr.offsets_size = 0;
        tr.data.ptr.offsets = 0;
    } else {