home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / bsd / 3146 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  1.7 KB

  1. Path: sparky!uunet!ogicse!plains!tinguely@plains.NoDak.edu
  2. From: tinguely@plains.NoDak.edu (Mark Tinguely)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: Questions/problems with 386BSD 0.1
  5. Message-ID: <19427@plains.NoDak.edu>
  6. Date: 29 Jul 92 22:19:54 GMT
  7. Article-I.D.: plains.19427
  8. References: <1992Jul29.042244.29277@umbc3.umbc.edu>
  9. Sender: Unknown@plains.NoDak.edu
  10. Organization: North Dakota State University
  11. Lines: 35
  12. Nntp-Posting-Host: plains.nodak.edu
  13.  
  14. In article <1992Jul29.042244.29277@umbc3.umbc.edu> cs481a07@umbc5.umbc.edu (cs481a07) writes:
  15.  
  16. >problem 3: I noticed that anyone could run shutdown. the permissions were
  17. >
  18. >-rwsr-x--- owner root group operator. I changed the permissions to
  19. >-r-x------ and anyone can still run it. (you get the shutdown: NOT super-user)
  20.  
  21.  This is a big security hole. In 0.0, a VOP_ACCESS was used, but root always
  22.  succeeds (and tries to execute anything). But the check for a single execute
  23.  bit it wrong too. I put the VOP_ACCESS back but also checked to make sure
  24.  at least one execute bit is on before root can execute the file. I also
  25.  checked if the filesystem was mount for execution:
  26.  
  27. *** kern_execve.c    Wed Jul 29 14:48:13 1992
  28. --- kern_execve.c.orig    Wed Jul  8 19:07:57 1992
  29. ***************
  30. *** 120,129 ****
  31.           goto exec_fail;
  32.   
  33.       /* is it executable, and a regular file? */
  34. !         if ((ndp->ni_vp->v_mount->mnt_flag & MNT_NOEXEC) ||
  35. !        (VOP_ACCESS(ndp->ni_vp, VEXEC, p->p_ucred, p)) ||
  36. !        ((attr.va_mode & 0111) == 0) ||
  37. !        (attr.va_type != VREG)) {
  38.           rv = EACCES;
  39.           goto exec_fail;
  40.       }
  41. --- 120,126 ----
  42.           goto exec_fail;
  43.   
  44.       /* is it executable, and a regular file? */
  45. !     if ((attr.va_mode & VEXEC) == 0 || attr.va_type != VREG) {
  46.           rv = EACCES;
  47.           goto exec_fail;
  48.       }
  49.