Re:How Dirty COW works from the Linux kernel’s perspective
by caf on Friday May 26, 2017 @07:04AM
(#14423199)
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.
[ Parent
| on HN ]
Re:How Dirty COW works from the Linux kernel’s perspective
by AstralStorm on Friday May 26, 2017 @07:23AM
(#14423282)
That 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.
Re:How Dirty COW works from the Linux kernel’s perspective
by caf on Friday May 26, 2017 @09:08AM
(#14423725)
In 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.