|
|
Subscribe / Log in / New account

Interesting discussion on ETXTBSY

Interesting discussion on ETXTBSY

Posted Sep 12, 2021 18:45 UTC (Sun) by nix (subscriber, #2304)
In reply to: Interesting discussion on ETXTBSY by neilbrown
Parent article: The shrinking role of ETXTBSY

> Currently only executables benefit from ETXTBSY. What if we added an O_DENYWRITE open flag.

What if we arranged for ETXTBSY to be emitted by default for files which have pages mapped executable in some process's address space? (The flag would obviously be flipped by the first mmap(MAP_EXEC) of that file, and flipped off by munmap). This is, obviously, a change in semantics, but surely not even jitters rely on writing to executable file-backed pages (differing cache coherency semantics make this operation intrinsically nonportable in any case).

This prevents the "easy DoS" of open-with-a-flag-to-deny-overwriting -- the only DoS vector now available is the one we already have, "execute something and nobody else can overwrite it while you're executing from it", which seems entirely, y'know, desirable.


to post comments


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