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