lkml.org 
[lkml]   [1998]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Anybody out there? (ETXTBSY)


On 28 Aug 1998, Andi Kleen 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.
>
> 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?

There are potentially executable files that we still don't want to allow
MAP_EXECUTABLE on, but yes, that general approach would also have worked.
The reason I disabled MAP_EXECUTABLE completely from user space was that I
had patches for it, not because I felt strongly for that being a
particularly good thing to do.

I actually like best the suggestion somebody had which was to do it
automatically when both the file and the mapping are executable, and
continue to use the MAP_EXECUTABLE flag as a purely kernel internal one.

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

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.082 / U:1.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site