d0dcc301f83b0e41de410acd62ade58c391e5e69
ArcSoft's dual-camera refocus library (libarcsoft_dualcam_refocus_rear_t.so)
executes a 2D convolution filter over image/disparity rows using NEON
instructions (vld1.32 {d28, d29, d30}, [r10]). Because it advances by
16 bytes per iteration but loads 24 bytes, the final iteration of each
row over-reads 8 bytes past the allocated buffer.
On Android 14/15, Scudo's memory layout enforces strict guard pages and
page unmapping. When an image buffer ends on a page boundary, this 8-byte
over-read triggers a fatal SEGV_MAPERR (SIGSEGV) at the adjacent page
boundary (e.g. 0xda005000), crashing the camera provider service when
capturing portrait photos in MIUI Camera.
All ArcSoft proprietary libraries route their allocations through
libmpbase's MMemAlloc, MMemRealloc, and MMemAllocStatic. Patch these
allocation functions to add 128 bytes of padding to every buffer,
ensuring all NEON sliding-window loads land safely within mapped memory.
Change-Id: Ib6fdc56e3b5493a9f808cdcce87d26dcdd914ed3
Languages
Makefile
100%