• Daniele Castagna's avatar
    exo: Fix shm_pool_resize · 6b48f624
    Daniele Castagna authored
    When we migrated GpuMemoryBufferHandle to the new shared memory API
    we didn't take into account that the previous SharedMemoryHandle would
    not enforce the size of the shared memory region stayed the same,
    while UnsafeSharedMemoryRegion does.
    
    Before using UnsafeSharedMemoryRegion we could pass the handle,
    ignore shm_pool_resize and map to an offset that is out of the original
    size we created the pool with.
    This breaks with UnsafeSharedMemoryRegion that checks the region we're
    mapping is contained in size.
    
    This CL implements shm_pool_resize, adding protocol checks and recreating
    UnsafeSharedMemoryRegion with the proper new size.
    
    Bug: 961155
    Change-Id: I443feca90ad332c40cb74f8a76182a20a565d7a6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1608800
    Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
    Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#660082}
    6b48f624
shared_memory.cc 4.25 KB