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

Skip to content
Commit f28ee068 authored by Colin Cross's avatar Colin Cross Committed by Ian Maund
Browse files

ion: fix overflow and list bugs in system heap



Fix a few bugs in ion_system_heap:

Initialize the list node in the info block.

Don't store size_remaining in a signed long, allocating >2GB
could overflow, resulting in a call to sg_alloc_table with
nents=0 which panics.  alloc_largest_available will never
return a block larger than size_remanining, so it can never
go negative.

Limit a single allocation to half of all memory.  Prevents a
large allocation from taking down the whole system.

Change-Id: I7fcbd7e1d5b4d482d7612d80b6c9e8e24466f1d8
Signed-off-by: default avatarColin Cross <ccross@android.com>
Git-commit: c69de844c80884167bb42243b36498dde81eebf6
Git-repo: http://android.googlesource.com/kernel/common/


[mitchelh@codeaurora.org: we already had the signed long fix]
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 0677049f
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