LWN.net Logo

Xorg flaw

Xorg flaw

Posted Aug 19, 2010 15:27 UTC (Thu) by nybble41 (subscriber, #55106)
In reply to: Xorg flaw by smurf
Parent article: An ancient kernel hole is closed

> How exactly do you prevent stack overflows?

This is not exactly a new problem. There is plenty of software out there (e.g. real-time embedded systems; the Linux kernel itself) which manages not to crash or misbehave when faced with a fixed-size stack and no special VM protection. The tools are simple:

1. Do not permit unbounded stack recursion.
2. Static analysis - know your worst-case stack requirements.

There may be "zillions" of application programs, but most of them don't run as root and simultaneously share memory with untrusted clients. As a privileged server process, Xorg should be designed to be more secure than most, since *any* code-execution vulnerability in Xorg is a (potentially remote) privilege-escalation vulnerability.

> Of course, X should not recursively overrun its stack.... So?

So it's not a kernel bug. It may be easier in this case to block one known exploit vector by changing the VM behavior of the kernel, and I'm not arguing against the patch, but it's not the kernel's job to prevent you from mapping untrusted memory right below your stack, or from overflowing said stack.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds