Re: Anybody out there? (ETXTBSY)

David Engel (dlengel@home.com)
Fri, 28 Aug 1998 09:41:04 -0500


On Fri, Aug 28, 1998 at 03:05:52AM +0000, Linus Torvalds wrote:
> 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.

Alan spoke with me about this problem last week since I still maintain
(though not very actively) the libc5 dynamic linker. I suggested he
take his idea to the linux-kernel list. Perhaps the idea wan't
expressed completely or a crucial part got lost in the noise. Anyway,
that crucial part is for the kernel to only use MAP_DENYWRITE when
MAP_EXECUTABLE is used AND the underlying file has the executable bit
set. Since binaries and shared libraries are the only files which
should have executable bits set, the type of denial-of-service attack
decscribed above should not be able to happen.

David

-- 
David Engel
dlengel@home.com

- 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