mirror of
https://github.com/LineageOS/android_kernel_samsung_msm8226.git
synced 2026-10-04 00:00:35 +02:00
When zeroing buffers, we need to make sure the zeroed data actually gets written back to RAM. Otherwise, it may be possible for a buffer to be reallocated with data still needing to be written back to RAM. This may lead to corruption from userspace allocators expecting zero'd buffers and a potential leak of kernel data to user space. Considering the mapping is short lived and we need to write back the data, use a writecombine mapping to write the data directly to ram and avoid the cost of flushing the cache. If the mapping is cached, invalidate the kernel side mappings as well. Change-Id: I26a49908bde411469f3b8f143a1581fb4e2c3b56 CRs-Fixed: 520044 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>