So lets say I have access to a process and its mm_struct, is there a way that I can change one of the mappings or remove a mapping and create a temporary one so that I can allocate an amount smaller than a page and have memory written to that?
For instance, process write faults on an ADD instruction. I can get the address and size of the fault with relative ease. I allocate 8 bytes locally (largest single instruction size) and mess with the mappings so that the virtual address that faulted points to the first byte of those 8 bytes. Then single step the instruction to get the data that was intended for another page and then restore the original page back to the mapping. I'm just curious as to whether something other than a page can be used in the virtual memory area for a process.