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

Skip to content
Commit fad5dbcf authored by Jordan Crouse's avatar Jordan Crouse Committed by Divya Ponnusamy
Browse files

msm: kgsl: Check for page aligned overflow in compat memory functions



Page aligned memory sizes in compatability mode are expected to be a
maximum of 32 bits. So if, for example, you specify a size of
0xfffffbff, the aligned size will overflow to 0 and the memory allocator
will rightly reject it.

But in the compat functions the size is cast to a (size_t) before getting
aligned, so the same address gets aligned to 0x100000000 which will either
fail the allocator or crash the system via OOM death.

Check for overflow in the compat functions after casting but before sending
to the allocator to support backwards compatibility with old tasks.

Change-Id: Ic0dedbaded3a41e6ebdb5108003c3aac161f4cbd
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: default avatarDivya Ponnusamy <pdivya@codeaurora.org>
parent 4a2f4120
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment