From d0dcc301f83b0e41de410acd62ade58c391e5e69 Mon Sep 17 00:00:00 2001 From: Raya Mahardika <94042378+rktdnt@users.noreply.github.com> Date: Wed, 23 Sep 2026 14:09:34 +0000 Subject: [PATCH] dipper: Patch libmpbase with SIMD tail padding 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 --- proprietary/vendor/lib/libmpbase.so | Bin 4936 -> 4936 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/proprietary/vendor/lib/libmpbase.so b/proprietary/vendor/lib/libmpbase.so index ff070b9b8e5dfdc017f11f89ef05d31a59da38a4..f7f87218cbcac3685ecbf175027b1eddcb5c1ab3 100644 GIT binary patch delta 33 pcmX@1c0z5#9#+QY$$MEBvotU?KH8kZ=EKC&Akg$^^A?UNTma|R4Iuyk delta 33 ocmX@1c0z5#9#%%?$$MEBvoJC&c(^%*&4-DFNdU;&!ZC#l0MJGY-v9sr