diff options
| author | 2020-10-22 15:40:45 -0700 | |
|---|---|---|
| committer | 2020-10-26 09:39:52 -0700 | |
| commit | dacdbd19f5500eda210fcde08bcfedcf9853f705 (patch) | |
| tree | 6fbe22d53802e01b65d675fd9f21c05b7191bcc7 /vulkan/libvulkan/api.cpp | |
| parent | 598420651aa61b619cc34f66ede84b8b7d671aca (diff) | |
MemoryHeapBase: Map as read-only when needed
When creating a MemoryHeapBase around a file descriptor provided by a
different process, either via an fd or a device name, the existing
code would attempt to map it with PROT_WRITE, unconditionally, which
would result in a failure to map.
With this change, we omit PROT_WRITE from the mapping whenever the
READ_ONLY flag is set, but only when accessing via one of these ctors.
The ctor that allocates a new ashmem region continues to work as
before, with the caller process having write access, but any other
process not having it.
Test: atest -p frameworks/native/libs/binder
Change-Id: Iab3583d841c3dceed1a7cb61e922a85104b4b00b
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions