Re: [PATCH -mm] utrace: nommu fixup support utrace

From: David Howells
Date: Wed Mar 07 2007 - 06:11:16 EST


Roland McGrath <roland@xxxxxxxxxx> wrote:

> That old ptrace check seems pretty questionable to me. I think what you
> want is for the nommu world's get_user_pages/access_process_vm when called
> with force=1,write=1 on a read-only MAP_PRIVATE page to do something more
> morally similar to the mmu world's COW than it does now.

Such as what? You *can't* do COW without relocating all the pointers userspace
may have into that VMA. However, unless you force non-sharing of R/O
MAP_PRIVATE VMAs, you will have text segments of executables and libraries
shared with other processes. Imagine: you set a breakpoint in uclibc read()
and your whole system dies instantly.

What I did is to say that if a process has PT_TRACED set then the MAP_PRIVATE
VMAs start with their own copies. The debugger can set this in a new process
by cloning it with appropriate CLONE_xxx flags.

It's not perfect, I know, but it's the best I could come up with as a solution
to debugging things in a NOMMU environment that supports shared libraries and
executables.

David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/