home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / wizards / 4798 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  2.7 KB

  1. Xref: sparky comp.unix.wizards:4798 comp.unix.questions:13634 comp.unix.programmer:5360 comp.unix.internals:1967
  2. Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!uwm.edu!biosci!agate!doc.ic.ac.uk!uknet!dsbc!kev
  3. From: kev@dsbc.icl.co.uk (Kevin Walsh)
  4. Newsgroups: comp.unix.wizards,comp.unix.questions,comp.unix.programmer,comp.unix.internals
  5. Subject: Re: Changing the owner of a process
  6. Message-ID: <959@dsbc.icl.co.uk>
  7. Date: 19 Nov 92 16:50:21 GMT
  8. References: <1992Nov5.152833.27744@dale.ksc.nasa.gov> <1992Nov17.142837.21252@dale.ksc.nasa.gov> <21902@rpp386.lonestar.org>
  9. Followup-To: comp.unix.wizards
  10. Organization: Cursor Software Limited, London, England
  11. Lines: 41
  12.  
  13. In article <21902@rpp386.lonestar.org> jfh@rpp386.cactus.org (John F. Haugh II) writes:
  14. > In article <1992Nov17.142837.21252@dale.ksc.nasa.gov> eposnak@dale.ksc.nasa.gov (Ed Posnak) writes:
  15. > [ This is actually one of the answers he quoted.  Mark Buda is the
  16. >   writer ... ]
  17. > >The uid, in every version of Unix I've seen, is stored in the proc
  18. > >structure in the kernel. You should be able to fiddle with this at
  19. > >will in a device driver, and since it's in the proc structure and not
  20. > >the u area, it'll always be there even if the process is swapped out.
  21. > >It *should* be just a matter of searching for the entry and changing
  22. > >it.
  23. > The UIDs are stored in the (struct user).  They are u.u_uid and u.u_ruid.
  24. > Without giving away too much, that's where the system looks for things
  25. > like access() and so on.  For a really bad time, check out the source
  26. > to suser().  It will convince you of this fact.
  27. > >This technique should also serve to implement something like renice()
  28. > >under Xenix, which doesn't have it. (The nice value also being stored
  29. > >in the proc structure.)
  30. > Unfortunately, now that we know the data is in the (struct user),
  31. > I won't be getting out my source to a XENIX renice ...  This also
  32. > means that the device driver idea won't work since the other processes
  33. > u-area may be anywheres.
  34. >
  35. The user structure (u area) for a foreign process isn't unobtainable.
  36. The process itself can be found easily and the u area should be one of
  37. the regions pointed to by the p_region member of the proc structure.
  38.  
  39. I missed the original post that must have given the reasons why this
  40. very dubious thing needs to be done anyway.  Sounds like an easy target
  41. for a security breach if you can change the uid of any process sumply by
  42. sending a pid and uid to a driver.
  43.  
  44. -- 
  45.    _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  46.   _/_/_/   _/_/      _/    _/    _/    _/_/  _/     K e v i n  W a l s h
  47.  _/ _/    _/          _/ _/     _/    _/  _/_/      kev@dsbc.icl.co.uk
  48. _/   _/  _/_/_/_/      _/    _/_/_/  _/    _/
  49.