unsafe fn patch_ioctl_slot(slot: *mut *mut c_void)Expand description
Repoint one ioctl GOT slot to filtered_ioctl.
- Make the page writable: read the slot’s current protection via
page_prot(defaulting to read/write when maps is unreadable) andmprotectthe page toPROT_READ | PROT_WRITE. - Publish the new pointer atomically: store
filtered_ioctlinto the slot with anAtomicPtrReleasestore, since another thread may be dispatching through this GOT slot concurrently and the write must not tear. - Restore protection: return the page to its original protection rather than a hardcoded read-only — under partial RELRO these libraries lazily bind through this page, so leaving it read-only would fault the next symbol resolve.