From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,fac98c00e61791bd X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-09-22 17:26:44 PST Newsgroups: comp.unix.osf.osf1 Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!news.kei.com!world!jeffc From: jeffc@world.std.com (Jeffrey D Carter) Subject: Re: OSF/1 2.0 does not protect program code Message-ID: Organization: The World Public Access UNIX, Brookline, MA References: <35bldr$ata@senior.nectec.or.th> <1994Sep21.175300.8122@inca.comlab.ox.ac.uk> Date: Thu, 22 Sep 1994 14:23:17 GMT mbeattie@sable.ox.ac.uk (Malcolm Beattie) writes: >In article <35bldr$ata@senior.nectec.or.th>, >Sompop Kumnoonsate wrote: >>What will happen if the running program file is replaced with a new >>program file? I found OSF/1 2.0 does not protect the program code. ... >The behaviour is still present in 3.0: copying a new image over an >executable which is in use by a process makes all processes using >that executable start spinning their wheels doing nothing useful. >Sheesh. I know older Unices had problems with overwriting executables >that were in use but I would have thought a modern Unix like OSF/1 This was a long-standing problem in the Mach code that OSF started with. Making ETXTBSY work correctly was "hard enough" that it eventually got bagged altogether (it became even more of a problem with shared library executables -- the thing actually exec-ed by the kernel is /sbin/loader, the real program and the shared libraries are mapped in later). This finally hacked me off enough that I fixed it in OSF/1 R1.2 (not to be confused withe DEC OSF/1 1.2, which was based more or less on OSF/1 R1.0.4 + R1.1). In OSF/1 releases since then, static executables, the loader (either /sbin/loader or /sbin/rtld) and shared executables are protected against overwrite via ETXTBSY. The shared libraries themselves are still a problem. Of course, this fix means that the "cp" command would fail, and you would have to use "mv" to rename the new excutable in place of the old one. To fix this "right" involves changes to the buffer cache/VM cache interactions that just aren't there. Ideally, ETXTBSY would not be necessary, and the overwrite would cause currently running programs to get private copies of the "old" version of the file. Mach certainly has sufficient VM snazziness to support this, but the file system layering in OSF/1 is challenged enough to make using it difficult. jeff carter Interware jeffc@world.std.com