Re: Anybody out there? (ETXTBSY)

Andi Kleen (ak@muc.de)
28 Aug 1998 13:17:24 +0200


In article <6s56qg$fo$1@palladium.transmeta.com>,
torvalds@transmeta.com (Linus Torvalds) writes:
> In article <19980827023536.C9225@dot.cygnus.com>,
> Richard Henderson <rth@cygnus.com> wrote:
>> On Wed, Aug 26, 1998 at 02:26:28PM -0500, pacman wrote:
>>> Is nobody interested on getting ETXTBSY to work for shared libs? Come on,
>>> take a break from the EFAULT wars and walk down the street to 26 Errno Lane
>>> and tell me what you think.
>>
>> ETXTBSY is explicitly not set on shared libraries. If you turn
>> it on, it is impossible to upgrade libc.so.

> No, the reason ETXTBSY is dangerous is mainly because it's a great
> denial-of-service thing. As such, the MAP_EXECUTABLE thing that Linux
> uses internally is not exported to user level, and as such the loader
> can't use it even if it wished.

> The reason MAP_EXECUTABLE isn't exported is programs like this:

> fd = open("/var/spool/utmp");
> mmap( ... fd ... MAP_EXECUTABLE ...);
> sleep(forever); /* nobody is able to log in */

> which used to actually happen.

How about only allowing MAP_EXECUTABLE on files that have the x bit set?
This would prevent this attack, and ETXTBSY could be properly implemented.

Or do I miss something here?

-Andi

-
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.altern.org/andrebalsa/doc/lkml-faq.html