ANDROID: 16K: [s]maps: Fold fixup entries into the parent entry
In x86_64 16kb emulation mode the kernel will insert anonymous VMAs at the end of filebacked of shmem mappings that are larger than the backing file. This is done inorder to avoid invalid file faults. The smaps/maps entries for fixup VMAs are currently hidden from userspace to prevent processes performing syscalls on non-page aligned addresses by scanning /proc/<pid>/[s]maps. However the end of the original VMA is left as a non-16kB aligned address. Fold the extend of the fixup VMA into the parent (preceding VMA). This hides fixup VMA completely from userspace and any operations performed with addresses from maps or smaps will be done on the orignal range. Before: 74b028b48000-74b028b49000 r--p 00000000 00:12 1441 /dev/test.so 74b028b4c000-74b028b50000 rw-p 00000000 00:00 0 [anon:Test mapping] The unaligned gap [74b028b49000-74b028b4c000] between the 2 test mappings is where the anon fixup was inserted. After: 74b028b48000-74b028b4c000 r--p 00000000 00:12 1441 /dev/test.so 74b028b4c000-74b028b50000 rw-p 00000000 00:00 0 [anon:Test mapping] There is no visible gap and the fixup mapping is now transparent to userpsace. Bug: 365566776 Bug: 365177458 Bug: 328777915 Bug: 331683943 Change-Id: Ibe2fe630695d875a8d7798f235adcf277b16bd9c Signed-off-by:Kalesh Singh <kaleshsingh@google.com> (cherry picked from commit 77e90f43)
Loading
Please sign in to comment