Olsonist
Olsonist

Reputation: 2403

How do you query memory mappings?

Is there a way to query whether a user memory address range is RO, RW, X, ...?

On BSD, POSIX ... systems mmap() and mprotect() can be used to set the memory protections of an address range. So there are 'setters' but what is the associated 'getter'?

I ask because a new exploit has surfaced, CoReV for Copy Relocation Violation. Basically, when instantiating a process, constant external variables that are referenced in executables are forcefully relocated to a writable memory segment without warning.

An Evil Copy: How the Loader Betrays You

For a constant section, the RO mapping would be 'set' by the loader. But with this exploit, it's necessary to validate the mapping at runtime and that needs a 'getter'.

Upvotes: 1

Views: 179

Answers (0)

Related Questions