> 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