Re: What I suspect

Linus Torvalds (torvalds@transmeta.com)
Wed, 8 Dec 1999 09:35:58 -0800 (PST)


On Wed, 8 Dec 1999, Richard Gooch wrote:
>
> Rather than having the kernel provide a special page which it fills
> with code (which in turn means more kernel bloat, as multiple
> implementations will need to be kept in an __init section), why not
> allow mmap(2) mappings to be inherited across execve(2)?
>
> Add a new MAP_INHERIT flag to specify which mappings are to be
> retained, and a new syscall to get the list of inherited mappings?

I like the idea in theory.

At the same time it just makes me cringe horribly from a security
standpoint. Imagine somebody changing that local mapping to use a trojan
horse system call, and then executing a setuid binary. Ugh.

Also, it would make it impossible to use the global TLB trick, but that
may not be worth worrying about.

So I think it's a great notion, but it just sucks in real life. And it
wouldn't allow the interesting things like gettimeofday() that really only
the kernel can do: you can calibrate the clock in user space, but you
cannot do things like automatically re-calibrate after a suspend event
etc, which is critical on laptops and will be even more so with the new
dual-frequency coppermine CPU's from Intel... (were not only the base time
changes, but the frequency of the clock changes too).

There _are_ a lot of issues like this where the kernel really knows things
that user space can not easily know.

Linus

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