Re: PTRACE_GET_THREAD_AREA

From: Linus Torvalds (torvalds@transmeta.com)
Date: Fri Dec 20 2002 - 12:36:37 EST


In article <20021220102431.A26923@infradead.org>,
Christoph Hellwig <hch@infradead.org> wrote:
>
>I don't think ptrace is the right interface for this. Just changed
>the get_thread_area/set_thread_area to take a new first pid_t argument.

No. There is _no_ excuse for even looking at (much less changing)
another process' thread area unless you are tracing that process.

Basically, there is only _one_ valid user of getting/setting the thread
area of somebody else, and that's for debugging. And debuggers use
ptrace. It's as simple as that. They use ptrace to read and set memory
contents, they use ptrace to read and set registers, and they should use
ptrace to check status bits of the process.

We do not introduce any extensions to existing system calls for
debuggers. We already have the interface, and one that does a lot better
at checking permissions in _one_ place than it would be to have magic
"can this process read/modify another process" things.

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



This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:27 EST