Ret2page: The Art of Exploiting Use-After-Free Vulnerabilities in the Dedicated Cache

Presented at Black Hat USA 2022, Aug. 11, 2022, 10:20 a.m. (40 minutes)

Heap isolation is effective mitigation that reduces the exploitability of certain types of vulnerabilities, especially Use-After-Free. In the Android/Linux kernel, A Use-After-Free vulnerability in a dedicated cache is difficult to exploit because none of the ideal victim objects can be directly allocated in the same cache, and from the Android11-5.4 kernel, CONFIG_SLAB_MERGE_DEFAULT is not set on default, which means dedicated caches are never merged into one to reduce memory fragmentation. Thus, to exploit a UAF vulnerability in a dedicated cache, the technique of cross-cache attack has to be applied. However, since the well-known cross-cache attack techniques are time-consuming and less deterministic, lots of Use-After-Free vulnerabilities in the dedicated cache cause little attention and are recognized as unexploitable bugs.

In this talk, I will introduce "Ret2page" - a new and generic exploitation technique. The key idea behind the new exploitation technique is to tame both the SLUB and BUDDY allocator. It aims to reduce time and memory consumption, and improve the success rate of physical page reuse. Moreover, to evaluate the effectiveness of the new exploitation technique and compare it with the well-known cross-cache attack techniques, I will analyze two typical Use-After-Free vulnerabilities fixed last year. Last but not least, to achieve the arbitrary kernel memory R/W ability and gain the root privilege, I will respectively detail how to exploit those two vulnerabilities, bypass the general mitigations(KASLR, PAN, etc), and build the universal Android rooting solutions.

During the presentation, I will give the exploit demos of rooting Android flagship devices. In summary, the new and generic exploitation technique and the ideas of exploitation have not been thoroughly presented in any previous talks.


Presenters:

  • Yong Wang - Security Engineer, Alibaba Security Pandora Lab
    Yong Wang (@ThomasKing2014) is a Security Engineer at Alibaba Security Pandora Lab. Yong is currently focusing on Android/Browser vulnerability hunting and exploitation. He was a speaker at several security conferences including Black Hat Asia 2018 and Europe 2019, HITB Amsterdam 2018, Zer0Con 2019, QPSS 2019, POC 2020, etc. Through the years, he has reported several vulnerabilities, and one of them was nominated for Pwine Award (2019).

Links:

Similar Presentations: