Exploiting Race Conditions Using the Scheduler
summary
Exploits two real bugs on a Google Pixel 2 (Linux 4.4): one races mremap against fallocate to produce a use-after-free of a physical page, then reallocates it as a page-cache page for a privileged library and wins code overwrite; another over-decrements struct file refs and uses a FUSE/userfault-style stall plus kcmp-based determinism to reliably reuse freed file structs. Both expand tiny timing windows by manipulating scheduling (pinning tasks, unprivileged sched_ syscalls*) and procfs counters; the techniques are implemented and shown to work.
AI-written summary · about
chapters (18)
- 0:00Intro
- 2:08Translation Lookaside Buffer (TLB)
- 2:59mremap() moving a memory mapping
- 3:40fallocate() (de)allocate space for a file
- 5:20Exploit plan: Basics
- 5:56Buddy allocator
- 9:09Preemption
- 10:12Scheduler control
- 12:25Android kernel exploit (app - zygote)
- 15:55userfaultfd and FUSE
- 17:46komp() for reliable UAF
- 20:00FUSE for exploiting struct file refcount
- 22:35int getpidcon(pid t pid, char **context)
- 24:02Bug 3: race condition in hwservicemanager
- 25:18_mutex on kernel 4.4
- 26:37Priority Inversion
- 27:57Major faults
- 29:16Repeated file mapping faults
related talks
45mThe Art of Exploiting Unconventional Use-after-free Bugs in Android Kernel
27mBad io_uring: A New Era of Rooting for Android
22mHunting and Exploiting Recursive MMIO Flaws in QEMU KVM
40mEvils in the Sparse Texture Memory: Exploit Kernel Based on Undefined Behaviors of Graphic APIs
51mExploiting Hardware Glitches And Side Channels In Perfect Software
55mControlling Multi-Core Race Conditions on Linux/Android
43mUsing Undocumented CPU Behavior to See Into Kernel Mode and Break KASLR in the Process
40mWinter is Coming Back
