Subject: Re: PROT_EXEC mappings of vnodes -> VTEXT
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 10/30/2001 11:41:38
> Many other UNIX variants demonstrably get it wrong, either by letting
> you make files unwritable by mmaping them PROT_EXEC, or by letting
> you crash running executables by overwriting their shared libraries.

I'll doubtless be called a heretic for it, but what's wrong with a
program crashing if you overwrite a file it's executing out of?
Whether that file is its program text or a shared library?

Even if you think crashes are a Wrong Thing, I'm still not convinced
ETXTBUSY is ever the way to do it.  ISTM that writing to a file that
backs a text page in use should have copy-on-write semantics: existing
mappings of that page continue to use the old data, now backed by swap
instead of the original vnode, and new mappings (of course) use the new
data.  ETXTBUSY is a bit like EFAULT, it seems to me: it was a kludge
put in to make it more convenient to implement back in the dark ages
but which has now hung on past its usefulness.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B