binder: fix async space check for 0-sized buffers
authorCarlos Llamas <cmllamas@google.com>
Fri, 1 Dec 2023 17:21:33 +0000 (17:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:41 +0000 (15:35 -0800)
commitfda6e06e01a951ee8f11658f81cd6cf12be0ad0b
treebed7a5cdf4d1b1aa9ff67ec1c8b83bf182199146
parent06173edfc770bb0fac067181db0c833fa7bbf031
binder: fix async space check for 0-sized buffers

commit 3091c21d3e9322428691ce0b7a0cfa9c0b239eeb upstream.

Move the padding of 0-sized buffers to an earlier stage to account for
this round up during the alloc->free_async_space check.

Fixes: 74310e06be4d ("android: binder: Move buffer out of area shared with user space")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-5-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder_alloc.c