* Help: how to set the ownership of a mounted floppy disk back to general user @ 1992-04-16 1:26 Alan S H Lam 1992-04-17 10:29 ` Chuck Qun Zheng 1992-04-20 16:48 ` Gary Heston 0 siblings, 2 replies; 21+ messages in thread From: Alan S H Lam @ 1992-04-16 1:26 UTC (permalink / raw) I can mount a 5000/25 DEC station floppy disk drive as a general user as long as the root has set: chmod +rwx /dev/rfd0a chmod +rwx /dev/fd0a However after the mounting, the ownership of the mount directory is root rather than the user even though the directory is created by the user and has been set to "chmod +rwx" by the user before mounting. The status of the mounted directory is still drwxr-xr-x. Hence, general user cannot directly copy any file to the floppy disk. As the above problem has not been solved, we cannot release the floppy disk drive to any general user to use except using the MTOOLS. If you know the solution of the above problem, please send me a e-mail. I will appreciate it very much. Thanks. shlam@eng.ie.cuhk.hk -- ==================================== Alan S. H. Lam Department of Information Engineering, CUHK, Hong Kong E-mail: shlam@eng.ie.cuhk.hk Tel: (852) 609 7975 Fax: (852) 603 5032 ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help: how to set the ownership of a mounted floppy disk back to general user 1992-04-16 1:26 Help: how to set the ownership of a mounted floppy disk back to general user Alan S H Lam @ 1992-04-17 10:29 ` Chuck Qun Zheng 1992-04-17 15:30 ` John F Haugh II 1992-04-20 16:48 ` Gary Heston 1 sibling, 1 reply; 21+ messages in thread From: Chuck Qun Zheng @ 1992-04-17 10:29 UTC (permalink / raw) In article <shlam.703387613@cucs11.cs.cuhk.hk>, shlam@cucs11.cs.cuhk.hk (Alan S H Lam) writes: |> |> I can mount a 5000/25 DEC station floppy disk drive as a general user |> |> as long as the root has set: |> |> chmod +rwx /dev/rfd0a |> chmod +rwx /dev/fd0a |> |> However after the mounting, the ownership of the mount directory is |> root rather than the user even though the directory is created by |> the |> user and has been set to "chmod +rwx" by the user before mounting. |> The status of the mounted directory is still drwxr-xr-x. Hence, |> general |> user cannot directly copy any file to the floppy disk. |> How about chown root.students /dev/rfd0a /dev/fd0a Or set gid to staff, grads, users, etc. Ultrix might well allow a user in many groups, like BSD. -- Chuck Qun Zheng Telecom Corperate Office Wellington, New Zealand chuck@bdev.corp.telecom.co.nz ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help: how to set the ownership of a mounted floppy disk back to general user 1992-04-17 10:29 ` Chuck Qun Zheng @ 1992-04-17 15:30 ` John F Haugh II 0 siblings, 0 replies; 21+ messages in thread From: John F Haugh II @ 1992-04-17 15:30 UTC (permalink / raw) In article <1992Apr17.102950.24105@corp.telecom.co.nz> chuck@comp.vuw.ac.nz (Chuck Qun Zheng) writes: >In article <shlam.703387613@cucs11.cs.cuhk.hk>, shlam@cucs11.cs.cuhk.hk >(Alan S H Lam) writes: >|> I can mount a 5000/25 DEC station floppy disk drive as a general user >|> |> as long as the root has set: >|> >|> chmod +rwx /dev/rfd0a >|> chmod +rwx /dev/fd0a >|> >|> However after the mounting, the ownership of the mount directory is >|> root rather than the user even though the directory is created by >|> the >|> user and has been set to "chmod +rwx" by the user before mounting. >|> The status of the mounted directory is still drwxr-xr-x. Hence, >|> general >|> user cannot directly copy any file to the floppy disk. >|> >How about > > chown root.students /dev/rfd0a /dev/fd0a > >Or set gid to staff, grads, users, etc. Ultrix might well allow a user in >many groups, like BSD. That won't fix it either. The problem is in the root directory on the floppy disk, more likely than not. You need to fix the floppy diskette before that directory will ever be changed - mounting the floppy puts the mounted-on directory underneath the root directory on the floppy itself. So, you need to chmod the directory =after= mounting, not before. As for changing the device, that only grants you access to the device. Once the floppy has been mounted, the permissions on the filesystem control access. Changing the modes on the device does nothing at all. -- John F. Haugh II | SITUATION WANTED: Ma Bell: (512) 251-2151 | Will write device drivers, turn status UUCP: ...!cs.utexas.edu!rpp386!jfh | reports in late, and whine incessantly Domain: jfh@rpp386.cactus.org | for food. Serious inquiries only ;-) ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help: how to set the ownership of a mounted floppy disk back to general user 1992-04-16 1:26 Help: how to set the ownership of a mounted floppy disk back to general user Alan S H Lam 1992-04-17 10:29 ` Chuck Qun Zheng @ 1992-04-20 16:48 ` Gary Heston [not found] ` <keithl.703861421@mukluk.cc.monash.edu.au> 1 sibling, 1 reply; 21+ messages in thread From: Gary Heston @ 1992-04-20 16:48 UTC (permalink / raw) In article <shlam.703387613@cucs11.cs.cuhk.hk> shlam@cucs11.cs.cuhk.hk (Alan S H Lam) writes: =I can mount a 5000/25 DEC station floppy disk drive as a general user =as long as the root has set: =chmod +rwx /dev/rfd0a =chmod +rwx /dev/fd0a =However after the mounting, the ownership of the mount directory is =root rather than the user even though the directory is created by the =user and has been set to "chmod +rwx" by the user before mounting. =The status of the mounted directory is still drwxr-xr-x. Hence, general =user cannot directly copy any file to the floppy disk. Since the floppy filesystem was almost certainly created by root, that's what ownership will be in it's root. Whatever was in the directory is superceeded by the filesystem info. Mount the floppy, change the ownership/permissions to 777 or something suitable, then distribute. -- Gary Heston SCI Systems, Inc. gary@sci34hub.sci.com site admin The Chariman of the Board and the CFO speak for SCI. I'm neither. "Always remember, that someone, somewhere, is making a product that will make your product obselete." Georges Doriot, founder of American R & D. ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <keithl.703861421@mukluk.cc.monash.edu.au>]
* dosread and doswrite for 3.5" floppies wanted [not found] ` <keithl.703861421@mukluk.cc.monash.edu.au> @ 1992-04-23 5:11 ` Richard Mackerras,Lamble 140,73-3464,71-1133 1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis 1992-04-23 16:04 ` Help: how to set the ownership of a mounted floppy disk back to general user Peter da Silva 2 siblings, 0 replies; 21+ messages in thread From: Richard Mackerras,Lamble 140,73-3464,71-1133 @ 1992-04-23 5:11 UTC (permalink / raw) From article <keithl.703861421@mukluk.cc.monash.edu.au>, by keithl@mukluk.cc.mon ash.edu.au (Keith Lewis): > The disks can still be used, however, as it is still possable to > write files to them with tar or dd... Or use dosread and doswrite to IBM > formatted disks. (sources in Tannenbaum's minix book might be used as a > strating point for the latter). Where can I get dosread and doswrite, I want to be able to read and write on PC formatted 3.5" 720Kb and 1.44Mb disks on a DECstation 3100? Richard Mackerras richard@metz.une.oz.au University of New England Armidale, NSW Australia ^ permalink raw reply [flat|nested] 21+ messages in thread
* Floppy Disk Security? (Re: Help: how to set the ownership ...) [not found] ` <keithl.703861421@mukluk.cc.monash.edu.au> 1992-04-23 5:11 ` dosread and doswrite for 3.5" floppies wanted Richard Mackerras,Lamble 140,73-3464,71-1133 @ 1992-04-23 12:32 ` Joseph Francis 1992-04-27 16:41 ` Steve McKinty - Sun ICNC ` (4 more replies) 1992-04-23 16:04 ` Help: how to set the ownership of a mounted floppy disk back to general user Peter da Silva 2 siblings, 5 replies; 21+ messages in thread From: Joseph Francis @ 1992-04-23 12:32 UTC (permalink / raw) In article <keithl.703861421@mukluk.cc.monash.edu.au> keithl@mukluk.cc.monash.edu.au (Keith Lewis) writes: >gary@sci34hub.sci.com (Gary Heston) writes: >>In article <shlam.703387613@cucs11.cs.cuhk.hk> shlam@cucs11.cs.cuhk.hk (Alan S H Lam) writes: >>=I can mount a 5000/25 DEC station floppy disk drive as a general user >>=... >>=However after the mounting, the ownership of the mount directory is >>=root rather than the user even though the directory is created by the ... > I assume you mean that root must mount the floppy and change >the ownership and permissions. There is an easier way of achieving this ... > Under Ultrix version 3 or thereabouts, we used to let our users >format (using /etc/rzdisk), initialise (using /etc/newfs), prototype (using ... >far as users are concerned). Setting suid 0 on rzdisk doesn't help. > Obviously there are rather grave security implications in having the >floppy disk file systems at all. Yes, I'm utterly curious about suid programs, and "root" ownership. What is to prevent someone with an appropriate disk drive to twiddle a few bits on a floppy and create suid root shells and such, mount and execute them? Enquiring minds want to know. In the far-flung future I may have to administer a group of laptop workstations, and aside from simply "Just Say NO" to mounted floppy filesystems, I can't see an easy solution. I know suid root can't propagate across NFS, for instance, but this is slightly different. A suid disallow bit on the /dev/<X> file permissions with appropriate driver modifications? -- | Le Jojo: Fresh 'n' Clean, speaking out to the way you want to live | today; American - All American; doing, a bit so, and even more so. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis @ 1992-04-27 16:41 ` Steve McKinty - Sun ICNC 1992-04-29 12:33 ` Nik Simpson 1992-04-27 19:09 ` Michael Thomas ` (3 subsequent siblings) 4 siblings, 1 reply; 21+ messages in thread From: Steve McKinty - Sun ICNC @ 1992-04-27 16:41 UTC (permalink / raw) In article <1992Apr23.123258.21085@ircam.fr>, francis@ircam.fr (Joseph Francis) writes: > > Yes, I'm utterly curious about suid programs, and "root" ownership. > What is to prevent someone with an appropriate disk drive to twiddle a > few bits on a floppy and create suid root shells and such, mount and > execute them? Enquiring minds want to know. In the far-flung future I > may have to administer a group of laptop workstations, and aside from > simply "Just Say NO" to mounted floppy filesystems, I can't see an "Just say No" is the best option. It is possible on at least some Unixes (maybe most, I don't know) to use a 'nosuid' option for mount, which prevents any suid programs from doing the suid. > easy solution. I know suid root can't propagate across NFS, for > instance, but this is slightly different. A suid disallow bit on the > /dev/<X> file permissions with appropriate driver modifications? I believe you can run an suid program across NFS provided the remote filesystem has not been mounted 'nosuid'. I mount all remote filesystems 'nosuid' (but then I'm naturally suspicious...) Steve ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-27 16:41 ` Steve McKinty - Sun ICNC @ 1992-04-29 12:33 ` Nik Simpson 1992-05-01 18:03 ` Peter da Silva 0 siblings, 1 reply; 21+ messages in thread From: Nik Simpson @ 1992-04-29 12:33 UTC (permalink / raw) In article <thar3INNdhj@grapevine.EBay.Sun.COM> smckinty@sunicnc.France.Sun.COM (Steve McKinty - Sun ICNC) writes: >In article <1992Apr23.123258.21085@ircam.fr>, francis@ircam.fr (Joseph Francis) writes: > > > > > Yes, I'm utterly curious about suid programs, and "root" ownership. > > What is to prevent someone with an appropriate disk drive to twiddle a > > few bits on a floppy and create suid root shells and such, mount and > > execute them? Enquiring minds want to know. In the far-flung future I > > may have to administer a group of laptop workstations, and aside from > > simply "Just Say NO" to mounted floppy filesystems, I can't see an > >"Just say No" is the best option. It is possible on at least some Unixes >(maybe most, I don't know) to use a 'nosuid' option for mount, which prevents >any suid programs from doing the suid. The problem of a mountable floppy file system can be overcome I think , I wrote a "mount" command for a floppy that does the following :- 1) Traps all user generated signals 2) Gets the real uid of the person running it, if uid=0 then the mounter is root already so no point in worrying 3) Change owner and group of Floppy device file to "root" and set protection to 700, this prevents later attacks with file system debuggers etc. 4) Mount the floppy file system. 5) Change owner and group of mount point to root and set protection to 700 this stops access while the rest of the checks are carried out. 6) Scan the floppy for any setuid/setgid files and remove the setuid or setgid bit. 7) Scan the floppy for any device files, change ownership to root and set protection to 550. 8) Reset permissions on the mount point to be owned by the mount requestor with 700 permissions. The corresponding unmount command just resets the permissions on the mount point and device file to appopriate values after unmounting the floppy. Since floppy file systems are rarely larger than 2500 blocks max the overhead of this checking is small. I think this makes the floppy mount command safe, If anybody can think of ways around this I'd be interested. The source is for a System V based machine, I don't know how portable it is as I don't have anything else to try it on, I'll mail the source on request. -- |--------------------------------------------------| | Nik Simpson Mail : nik@ingr.com | | Intergraph Corp. System Product Marketing | |--------------------------------------------------| ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-29 12:33 ` Nik Simpson @ 1992-05-01 18:03 ` Peter da Silva 0 siblings, 0 replies; 21+ messages in thread From: Peter da Silva @ 1992-05-01 18:03 UTC (permalink / raw) In article <1992Apr29.123349.26439@nik.b23a.ingr.com> nik@nik.b23a.ingr.com (Nik Simpson) writes: > Since floppy file systems are rarely larger than 2500 blocks max the > overhead of this checking is small. I think this makes the floppy mount > command safe, If anybody can think of ways around this I'd be interested. Mount the floopy. Do a bunch of hard disk I/O (flush the buffer cache). Remove the floppy without unmounting it. (a) Insert nasty magic here. Reinsert the floppy. Become root. -- (a) may require hardware hacks on a Mac-style (software ejected) floppy. not a problem with 5.25" floppies. -- Peter da Silva `-_-' Programmer, network firefighter, thrillseeker 'U` Ferranti International Controls Corporation Have you hugged Sugar Land, TX 77487-5012 +1 713 274 5180 your wolf today? ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis 1992-04-27 16:41 ` Steve McKinty - Sun ICNC @ 1992-04-27 19:09 ` Michael Thomas [not found] ` <1992Apr27.210248.11691@sura.net> 1992-04-27 19:14 ` Floppy Disk Security? John F. Haugh II ` (2 subsequent siblings) 4 siblings, 1 reply; 21+ messages in thread From: Michael Thomas @ 1992-04-27 19:09 UTC (permalink / raw) In article <1992Apr23.123258.21085@ircam.fr>, francis@ircam.fr (Joseph Francis) writes: |> Yes, I'm utterly curious about suid programs, and "root" ownership. |> What is to prevent someone with an appropriate disk drive to twiddle a |> few bits on a floppy and create suid root shells and such, mount and |> execute them? Enquiring minds want to know. In the far-flung future I |> may have to administer a group of laptop workstations, and aside from |> simply "Just Say NO" to mounted floppy filesystems, I can't see an |> easy solution. I know suid root can't propagate across NFS, for |> instance, but this is slightly different. A suid disallow bit on the |> /dev/<X> file permissions with appropriate driver modifications? I think that the key is that mount is a priviledged command. If you are root you are already allowed to diddle. Therefore the is no breach. -- Michael Thomas (mike@gordian.com) "I don't think Bambi Eyes will get you that flame thrower..." -- Hobbes to Calvin USnail: 20361 Irvine Ave Santa Ana Heights, Ca, 92707-5637 PaBell: (714) 850-0205 (714) 850-0533 (fax) ^ permalink raw reply [flat|nested] 21+ messages in thread
[parent not found: <1992Apr27.210248.11691@sura.net>]
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) [not found] ` <1992Apr27.210248.11691@sura.net> @ 1992-04-27 21:27 ` Michael Thomas 1992-04-28 17:06 ` Martyn Johnson 0 siblings, 1 reply; 21+ messages in thread From: Michael Thomas @ 1992-04-27 21:27 UTC (permalink / raw) In article <1992Apr27.210248.11691@sura.net>, lidl@sura.net (Kurt J. Lidl) writes: |> "mount" is not privledged under Ultrix. All you need is ownership of |> the mount point. Gack! I just looked at the man page for RiscOS (mips) and SunOS, and they are priviledged commands. (Actually it is mount(2) which requires root) This is a pretty gross security hole! -- Michael Thomas (mike@gordian.com) "I don't think Bambi Eyes will get you that flame thrower..." -- Hobbes to Calvin USnail: 20361 Irvine Ave Santa Ana Heights, Ca, 92707-5637 PaBell: (714) 850-0205 (714) 850-0533 (fax) ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-27 21:27 ` Michael Thomas @ 1992-04-28 17:06 ` Martyn Johnson 0 siblings, 0 replies; 21+ messages in thread From: Martyn Johnson @ 1992-04-28 17:06 UTC (permalink / raw) In article <1992Apr27.212729.9887@gordian.com>, mike@gordian.com (Michael Thomas) writes: |> In article <1992Apr27.210248.11691@sura.net>, lidl@sura.net (Kurt J. Lidl) writes: |> |> "mount" is not privledged under Ultrix. All you need is ownership of |> |> the mount point. |> |> Gack! I just looked at the man page for RiscOS (mips) and SunOS, and |> they are priviledged commands. (Actually it is mount(2) which requires |> root) This is a pretty gross security hole! So read the Ultrix man page too: General users can only mount file systems with certain res- trictions. For example, the user, other than the superuser, performing the mount must own the directory directory. Furthermore, no users other than the superuser can execute setuid or setgid programs on the mounted file systems. In addition, users other than the superuser cannot access block or special character devices such as rra0g on the mounted file systems. In other words, if a general user does the mount, setuid, setgid and device special files are automatically locked out. Thus it is not a security hole. Martyn Johnson maj@cl.cam.ac.uk University of Cambridge Computer Lab Cambridge UK ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? 1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis 1992-04-27 16:41 ` Steve McKinty - Sun ICNC 1992-04-27 19:09 ` Michael Thomas @ 1992-04-27 19:14 ` John F. Haugh II 1992-04-28 8:43 ` Ian G Batten 1992-04-28 12:19 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Gary Heston 1992-05-01 13:02 ` Drew Eckhardt 4 siblings, 1 reply; 21+ messages in thread From: John F. Haugh II @ 1992-04-27 19:14 UTC (permalink / raw) In article <1992Apr23.123258.21085@ircam.fr>, francis@ircam.fr (Joseph Francis) writes: > Yes, I'm utterly curious about suid programs, and "root" ownership. > What is to prevent someone with an appropriate disk drive to twiddle a > few bits on a floppy and create suid root shells and such, mount and > execute them? Enquiring minds want to know. In the far-flung future I > may have to administer a group of laptop workstations, and aside from > simply "Just Say NO" to mounted floppy filesystems, I can't see an > easy solution. I know suid root can't propagate across NFS, for > instance, but this is slightly different. A suid disallow bit on the > /dev/<X> file permissions with appropriate driver modifications? What you need to do is write a version of the mount command that scans the diskette for violating programs before performing the "mount". Let your unwashed masses run that priviledged program and do the mount. As always, we again find that there is a small race condition, but that's what UNIX is all about, right? ;-) -- John F. Haugh II | SITUATION WANTED: Ma Bell: (512) 251-2151 | Will write device drivers, turn status UUCP: ...!cs.utexas.edu!rpp386!jfh | reports in late, and whine incessantly Domain: jfh@rpp386.cactus.org | for food. Serious inquiries only ;-) ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? 1992-04-27 19:14 ` Floppy Disk Security? John F. Haugh II @ 1992-04-28 8:43 ` Ian G Batten 0 siblings, 0 replies; 21+ messages in thread From: Ian G Batten @ 1992-04-28 8:43 UTC (permalink / raw) In article <20680@rpp386.lonestar.org> jfh@rpp386.lonestar.org (John F. Haugh II) writes: > What you need to do is write a version of the mount command that scans > the diskette for violating programs before performing the "mount". Let > your unwashed masses run that priviledged program and do the mount. Or simply have a setuid program which does the mount but insists upon setting the nosuid flag (assuming it's available). > As always, we again find that there is a small race condition, but that's > what UNIX is all about, right? ;-) I though a race condition was the leader board at a Grand Prix until I discovered Unix :-) ian ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis ` (2 preceding siblings ...) 1992-04-27 19:14 ` Floppy Disk Security? John F. Haugh II @ 1992-04-28 12:19 ` Gary Heston 1992-05-01 14:02 ` Drew Eckhardt 1992-05-01 13:02 ` Drew Eckhardt 4 siblings, 1 reply; 21+ messages in thread From: Gary Heston @ 1992-04-28 12:19 UTC (permalink / raw) In article <1992Apr23.123258.21085@ircam.fr> francis@ircam.fr (Joseph Francis) writes: [ ... ] =Yes, I'm utterly curious about suid programs, and "root" ownership. =What is to prevent someone with an appropriate disk drive to twiddle a =few bits on a floppy and create suid root shells and such, mount and =execute them? At the moment, there doesn't seem to be anything preventing them, other than physical security of the systems' floppy drive. I wonder if a tape could be similarly rigged--dump a script to it with tar or cpio, dd the image in, twiddle a few bits, dd it back out, and tar/cpio it back in. I don't believe either of them clears suid bits, or doing a system restore after a crash would be miserable. Ack. Nothing is safe; there's no security--better get a few bags of concrete and encase my systems.... :-) = Enquiring minds want to know. In the far-flung future I =may have to administer a group of laptop workstations, and aside from =simply "Just Say NO" to mounted floppy filesystems, I can't see an =easy solution. I know suid root can't propagate across NFS, for =instance, but this is slightly different. A suid disallow bit on the =/dev/<X> file permissions with appropriate driver modifications? How about a suid program specific to mounting floppies? If it incorporates a scan for suid programs or scripts, and refuses to mount (unless being run by root or the suid owner), that should provide adequate protection, and doesn't require writing a new driver (or making internal changes). -- Gary Heston SCI Systems, Inc. gary@sci34hub.sci.com site admin The Chariman of the Board and the CFO speak for SCI. I'm neither. "Always remember, that someone, somewhere, is making a product that will make your product obselete." Georges Doriot, founder of American R & D. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-28 12:19 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Gary Heston @ 1992-05-01 14:02 ` Drew Eckhardt 1992-05-04 15:47 ` Gary Heston 1992-05-04 23:29 ` Peter da Silva 0 siblings, 2 replies; 21+ messages in thread From: Drew Eckhardt @ 1992-05-01 14:02 UTC (permalink / raw) In article <1992Apr28.121914.10226@sci34hub.sci.com> gary@sci34hub.sci.com (Gary Heston) writes: >In article <1992Apr23.123258.21085@ircam.fr> francis@ircam.fr (Joseph Francis) writes: > [ ... ] >=Yes, I'm utterly curious about suid programs, and "root" ownership. >=What is to prevent someone with an appropriate disk drive to twiddle a >=few bits on a floppy and create suid root shells and such, mount and >=execute them? The nosuid flag for mount. >At the moment, there doesn't seem to be anything preventing them, >other than physical security of the systems' floppy drive. I wonder >if a tape could be similarly rigged--dump a script to it with tar >or cpio, dd the image in, twiddle a few bits, dd it back out, and >tar/cpio it back in. I don't believe either of them clears suid >bits, or doing a system restore after a crash would be miserable. > You are correct in stating thattar does not clear ownership / permissions, or suid bits, when saving files. However : Chown(2) is only executable by root, so a normal user cannot extract a file from a tar, suid or not, and have it owned by some one else. Chmod(2) is only executable by the owner of a file, or root, so no normal user can make someone else's file suid either. So, a normal user can extract suid programs from tape owned by him, or owned by others and have them become owned by him, but cannot create files owned by anyone else, let alone suid files. >Ack. Nothing is safe; there's no security--better get a few bags of >concrete and encase my systems.... :-) Of course there is some security. You just have to know about it by reading TFM and when that doesn't work because of the shoddy man pages included with todays systems, RTFS, which because of brain damaged source licenses doesn't always work 8^) PEEVE : shoddy man pages. I got BSD 4.3 Reno up on my VAX 11/785, and went off to a Sun to read /usr/src off of the tape. I don't normally deal with 9 tracks kept around for reading distributions like this, and found out that getting this single tar file off tape made installing sendmail seem trivial in comparison. (I'm serious here. If you don't use IDA sendmail and m4 config source, do it, and you'll see what I mean) Now, many tar, and dump man pages I've seen have had device names WITH DENSITY under the FILES subhead. Of course, SUN doesn't do that anymore. All in the name of progress, I guess. SEE ALSO mtio(4) didn't have it, SEE ALSO tm(4) didn't have it, it took until I got down to SEE ALSO xt(4) which superceeded tm(4). That didn't work. Of course, tar automatically determines block size when doing an x or t (as stated in the Sun man page). What it didn't say is "Some hardware devices such as the 9 track tape drives return hard error codes when you read at a blocking factor other than what was specified when the tape was written" After a few hard errors, time to go home, and a day off, we suspected something this sinister, eventually had to go from the sub basement, up to the first floor in another wing of the building where the tape drive was, read the label, use that block size, and it worked. I shouldn't have had to do that. With gigabytes of disk online, I can spare room in my /usr/man or /usr/share/man directory for a few extra lines per file saying "/dev/rmt0 is the low density device. /dev/rmt8 is the high density, typically 6250 bpi device. /dev/nrmt* are the nonrewinding devices." under subhead FILES and "When reading from a pipe or regular file, the x and t options automatically determine block size. However, when reading from certain devices, notably /dev/{n,}rmt*, block size must be explicitly specified with the b flag or a hard error may result" under both subhead DESCRIPTION, and DIAGNOSTICS in case I though I knew more than I did, and merely skimmed the man page. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-05-01 14:02 ` Drew Eckhardt @ 1992-05-04 15:47 ` Gary Heston 1992-05-04 23:29 ` Peter da Silva 1 sibling, 0 replies; 21+ messages in thread From: Gary Heston @ 1992-05-04 15:47 UTC (permalink / raw) In article <1992May1.140241.4112@colorado.edu> drew@ladymacb.cs.colorado.edu (Drew Eckhardt) writes: >In article <1992Apr28.121914.10226@sci34hub.sci.com> gary@sci34hub.sci.com (Gary Heston) writes: [ while discussing suid files ] >You are correct in stating thattar does not clear ownership / permissions, or >suid bits, when saving files. >However : >Chown(2) is only executable by root, so a normal user cannot extract a >file from a tar, suid or not, and have it owned by some one else. This is the case on BSD-derived systems, but not SysV. Chown does clear suid bits, though, to avoid the chmod 4555 / chown root sequence that was possible in an earlier version of Unix. -- Gary Heston SCI Systems, Inc. gary@sci34hub.sci.com site admin The Chariman of the Board and the CFO speak for SCI. I'm neither. "Always remember, that someone, somewhere, is making a product that will make your product obselete." Georges Doriot, founder of American R & D. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-05-01 14:02 ` Drew Eckhardt 1992-05-04 15:47 ` Gary Heston @ 1992-05-04 23:29 ` Peter da Silva 1 sibling, 0 replies; 21+ messages in thread From: Peter da Silva @ 1992-05-04 23:29 UTC (permalink / raw) In article <1992May1.140241.4112@colorado.edu> drew@ladymacb.cs.colorado.edu (Drew Eckhardt) writes: > Chown(2) is only executable by root, so a normal user cannot extract a > file from a tar, suid or not, and have it owned by some one else. This is not true under System V. > Chmod(2) is only executable by the owner of a file, or root, > so no normal user can make someone else's file suid either. This, however, is. Plus, the setuid bit goes away when you chown. -- Peter da Silva `-_-' Programmer, network firefighter, thrillseeker 'U` Ferranti International Controls Corporation Have you hugged Sugar Land, TX 77487-5012 +1 713 274 5180 your wolf today? ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) 1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis ` (3 preceding siblings ...) 1992-04-28 12:19 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Gary Heston @ 1992-05-01 13:02 ` Drew Eckhardt 4 siblings, 0 replies; 21+ messages in thread From: Drew Eckhardt @ 1992-05-01 13:02 UTC (permalink / raw) In article <1992Apr23.123258.21085@ircam.fr> francis@ircam.fr (Joseph Francis) writes: >In article <keithl.703861421@mukluk.cc.monash.edu.au> keithl@mukluk.cc.monash.edu.au (Keith Lewis) writes: > >Yes, I'm utterly curious about suid programs, and "root" ownership. >What is to prevent someone with an appropriate disk drive to twiddle a >few bits on a floppy and create suid root shells and such, mount and >execute them? Enquiring minds want to know. In the far-flung future I You can specify a nosuid mount option. Since mount(2) is only callable by root, normal users cannot run mount(1) unless it is suid to root. So, you make a setuid to root program / shell script (remember about the - after the interpreter name), that runs mount(1) or calls mount(2) and mounts the floppy nosuid. Normal users can't mount floppies with setuid enabled, and it isn't a problem. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help: how to set the ownership of a mounted floppy disk back to general user [not found] ` <keithl.703861421@mukluk.cc.monash.edu.au> 1992-04-23 5:11 ` dosread and doswrite for 3.5" floppies wanted Richard Mackerras,Lamble 140,73-3464,71-1133 1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis @ 1992-04-23 16:04 ` Peter da Silva 1992-04-26 20:07 ` Jonathan I. Kamens 2 siblings, 1 reply; 21+ messages in thread From: Peter da Silva @ 1992-04-23 16:04 UTC (permalink / raw) In article <keithl.703861421@mukluk.cc.monash.edu.au> keithl@mukluk.cc.monash.edu.au (Keith Lewis) writes: > Under Ultrix version 3 or thereabouts, we used to let our users > format (using /etc/rzdisk), initialise (using /etc/newfs), prototype (using > /etc/mkproto) and mount floppy disks. I've been following this thread for a while. What's to stop some user from binary editing a diskette offline to have dangerous files in it (setuid files, device files, etc) and mounting it? Why would you want to let users have this sort of ability? -- Peter da Silva `-_-' Programmer, network firefighter, thrillseeker 'U` Ferranti International Controls Corporation Have you hugged Sugar Land, TX 77487-5012 +1 713 274 5180 your wolf today? ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help: how to set the ownership of a mounted floppy disk back to general user 1992-04-23 16:04 ` Help: how to set the ownership of a mounted floppy disk back to general user Peter da Silva @ 1992-04-26 20:07 ` Jonathan I. Kamens 0 siblings, 0 replies; 21+ messages in thread From: Jonathan I. Kamens @ 1992-04-26 20:07 UTC (permalink / raw) In article <id.YS4P.ODL@ferranti.com> peter@ferranti.com (Peter da Silva) writes: I've been following this thread for a while. What's to stop some user from binary editing a diskette offline to have dangerous files in it (setuid files, device files, etc) and mounting it? Why would you want to let users have this sort of ability? Well, you can always disable setuid binaries by setting nosuid when mounting the floppy in the program that does the mounting. What we really need is a "nodev" option to cause special files to be ignored on a filesystem if it is set when the filesystem is mounted. Does any vendor have this already? Another approach is simply not to care whether or not the users can mount setuid files, device files, etc. If your workstations are dataless, single-user workstations on which superuser access does not gain the user anything, such as the workstations at Athena, this is possible. We've been letting users mount arbitrary filesystems for years; for that matter, we publish the root password of our public workstations widely (it's "mrroot"). No, I'm not going to get into the argument, for the nth time, of whether or not this is a good thing. It works for us. If you don't understand why, read some of the papers that have been published by Athena; I don't have the energy to go through the argument again. -- Jonathan Kamens jik@MIT.Edu MIT Information Systems/Athena Moderator, news.answers (Send correspondence related to the news.answers newsgroup {and ONLY correspondence related to the newsgroup} to news-answers-request@MIT.Edu.) ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~1992-05-04 23:29 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1992-04-16 1:26 Help: how to set the ownership of a mounted floppy disk back to general user Alan S H Lam
1992-04-17 10:29 ` Chuck Qun Zheng
1992-04-17 15:30 ` John F Haugh II
1992-04-20 16:48 ` Gary Heston
[not found] ` <keithl.703861421@mukluk.cc.monash.edu.au>
1992-04-23 5:11 ` dosread and doswrite for 3.5" floppies wanted Richard Mackerras,Lamble 140,73-3464,71-1133
1992-04-23 12:32 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Joseph Francis
1992-04-27 16:41 ` Steve McKinty - Sun ICNC
1992-04-29 12:33 ` Nik Simpson
1992-05-01 18:03 ` Peter da Silva
1992-04-27 19:09 ` Michael Thomas
[not found] ` <1992Apr27.210248.11691@sura.net>
1992-04-27 21:27 ` Michael Thomas
1992-04-28 17:06 ` Martyn Johnson
1992-04-27 19:14 ` Floppy Disk Security? John F. Haugh II
1992-04-28 8:43 ` Ian G Batten
1992-04-28 12:19 ` Floppy Disk Security? (Re: Help: how to set the ownership ...) Gary Heston
1992-05-01 14:02 ` Drew Eckhardt
1992-05-04 15:47 ` Gary Heston
1992-05-04 23:29 ` Peter da Silva
1992-05-01 13:02 ` Drew Eckhardt
1992-04-23 16:04 ` Help: how to set the ownership of a mounted floppy disk back to general user Peter da Silva
1992-04-26 20:07 ` Jonathan I. Kamens
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox