Re: [PATCH] staging: android: ion: Bail out upon SIGKILL when allocating memory.

From: Laura Abbott
Date: Mon Jul 01 2019 - 17:21:43 EST


On 7/1/19 5:02 PM, Tetsuo Handa wrote:
On 2019/07/01 23:02, Sumit Semwal wrote:
Acked-by: Laura Abbott <labbott@xxxxxxxxxx>
fwiw, Acked-by: Sumit Semwal <sumit.semwal@xxxxxxxxxx>

Thank you for responding. You can carry this patch via whichever tree you like.

By the way, is "memory allocation from ion_system_heap_allocate() is calling
ion_system_heap_shrink()"
( https://lkml.kernel.org/r/03763360-a7de-de87-eb90-ba7838143930@xxxxxxxxxxxxxxxxxxx )
what we want? Such memory allocations might not want to call shrinkers...


For what Ion gets typically used for we do want to be calling shrinkers.
I've had discussions with people in the past about the risk of Ion as
DoS vector due to its ability to allocate large amounts of memory.
At the very least, we probably shouldn't be trying to call the Ion shrinker
when we're in the middle of an ion allocation since shrinking won't do us
any good. We're in the process of re-working Ion at the moment so this
might be a good topic to bring up again.

Thanks,
Laura