3 ms·
It's not made completely explicit here, but one reason you want debuggers to be able to write even to read-only mappings in the debuggee is to be able to insert
by caf 9y ago
It's not made completely explicit here, but one reason you want debuggers to be able to write even to read-only mappings in the debuggee is to be able to insert software breakpoints, which entails writing to the mapping of the executable file.
- AstralStorm 9y agoThat is supposed to be limited to processes with ptrace rights. Which are highly privileged. Generally what happened here is that a piece of state got lost in the layers of abstraction. This combined with a race condition is enough.
- caf 9y agoIn common setups ptrace rights aren't highly privileged, the normal situation is that users can ptrace their own processes. To be clear, I'm just adding a bit of context around why a page in a read-only mapping is COWed when these debugging interfaces are used to write to it, rather than failing with an exception. The bug existed in the handling of this edge-case.