From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10952f,b69d377feb5a8a2 X-Google-Attributes: gid10952f,public X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public X-Google-Thread: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public From: "Rev. Don Kool" Subject: Re: Secure cleaning of /tmp was Different Unixes pros & cons Date: 1998/09/21 Message-ID: <3606D911.23841BE9@home.com>#1/1 X-Deja-AN: 393451525 Content-Transfer-Encoding: 7bit References: <35F71814.1E0B911C@iakom.com> <36069B1E.14553C26@llnl.gov> <6u67of$cae@web.nmti.com> <51zN1.54$LN.897820@burlma1-snr1.gtei.net> <6u6gie$fgk@web.nmti.com> Followup-To: comp.unix.admin Content-Type: text/plain; charset=us-ascii Organization: Jack Daniel's Field Testing Services, Inc. MIME-Version: 1.0 NNTP-Posting-Date: Mon, 21 Sep 1998 15:54:10 PDT Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix Peter da Silva wrote: > Barry Margolin wrote: > >If your goal is to avoid race conditions that can be used as security > >holes, you're probably right. But if your goal is a fully correct /tmp > >cleaner, possibilities like this will always exist unless special kernel > >support is provided. > There's a number of hacks you can use to get the same result, though they > do require moderate exotica... they're not specifically kernel support for > temp cleaning. > > You could use union mounts. Union mount a new temp over the old one before > you run the cleaner on the old one. Now the problem reduces to what happens > when you run out of resources for the nth union mount. You'd need to be able > to unmount stuff from the bottom of the mount stack. > > If you have variable symlinks you can pull a nasty trick: > > mkdir /usrtmp > for user in ($USERS) > do mkdir /usrtmp/$i; chown $i /usrtmp/$i > done > ln -s '/usrtmp/$(LOGNAME)/tmp' /tmp # modulo variable symlink syntax > > Now anyone accessing /tmp will find themselves in a private temp dir they own. > > Best would be a special tmpfs with file aging. Of course you could just reboot and avoid the "race condition" altogether. Much more secure. :-) Hope this helps, Don -- ********************** You a bounty hunter? * Rev. Don McDonald * Man's gotta earn a living. * Baltimore, MD * Dying ain't much of a living, boy. ********************** "Outlaw Josey Wales" http://members.home.net/oldno7