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:Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Divya Ponnusamy <pdivya@codeaurora.org>
Loading
Please register or sign in to comment