Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2001 09:59:12 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/lib/libkvm kvm_proc.c src/sys/alpha/osf1 osf1_misc.c src/sys/compat/linprocfs linprocfs_misc.c linprocfs_vnops.c src/sys/compat/linux linux_misc.c src/sys/compat/svr4 svr4_misc.c svr4_sysvec.c src/sys/ddb db_ps.c ...
Message-ID:  <200105251659.f4PGxCm49043@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
rwatson     2001/05/25 09:59:12 PDT

  Modified files:
    lib/libkvm           kvm_proc.c 
    sys/alpha/osf1       osf1_misc.c 
    sys/compat/linprocfs linprocfs_misc.c linprocfs_vnops.c 
    sys/compat/linux     linux_misc.c 
    sys/compat/svr4      svr4_misc.c svr4_sysvec.c 
    sys/ddb              db_ps.c 
    sys/fs/procfs        procfs_status.c procfs_vnops.c 
    sys/i386/linux       linux_sysvec.c 
    sys/kern             init_main.c kern_acct.c kern_descrip.c 
                         kern_exec.c kern_exit.c kern_fork.c 
                         kern_ktrace.c kern_proc.c kern_prot.c 
                         kern_sig.c uipc_usrreq.c vfs_syscalls.c 
    sys/nfs              nfs_lock.c 
    sys/posix4           p1003_1b.c 
    sys/sys              filedesc.h proc.h ucred.h 
    sys/ufs/ufs          ufs_extattr.c ufs_vfsops.c 
  Log:
  o Merge contents of struct pcred into struct ucred.  Specifically, add the
    real uid, saved uid, real gid, and saved gid to ucred, as well as the
    pcred->pc_uidinfo, which was associated with the real uid, only rename
    it to cr_ruidinfo so as not to conflict with cr_uidinfo, which
    corresponds to the effective uid.
  o Remove p_cred from struct proc; add p_ucred to struct proc, replacing
    original macro that pointed.
    p->p_ucred to p->p_cred->pc_ucred.
  o Universally update code so that it makes use of ucred instead of pcred,
    p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo,
    cr_{r,sv}{u,g}id instead of p_*, etc.
  o Remove pcred0 and its initialization from init_main.c; initialize
    cr_ruidinfo there.
  o Restruction many credential modification chunks to always crdup while
    we figure out locking and optimizations; generally speaking, this
    means moving to a structure like this:
          newcred = crdup(oldcred);
          ...
          p->p_ucred = newcred;
          crfree(oldcred);
    It's not race-free, but better than nothing.  There are also races
    in sys_process.c, all inter-process authorization, fork, exec, and
    exit.
  o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid;
    remove comments indicating that the old arrangement was a problem.
  o Restructure exec1() a little to use newcred/oldcred arrangement, and
    use improved uid management primitives.
  o Clean up exit1() so as to do less work in credential cleanup due to
    pcred removal.
  o Clean up fork1() so as to do less work in credential cleanup and
    allocation.
  o Clean up ktrcanset() to take into account changes, and move to using
    suser_xxx() instead of performing a direct uid==0 comparision.
  o Improve commenting in various kern_prot.c credential modification
    calls to better document current behavior.  In a couple of places,
    current behavior is a little questionable and we need to check
    POSIX.1 to make sure it's "right".  More commenting work still
    remains to be done.
  o Update credential management calls, such as crfree(), to take into
    account new ruidinfo reference.
  o Modify or add the following uid and gid helper routines:
        change_euid()
        change_egid()
        change_ruid()
        change_rgid()
        change_svuid()
        change_svgid()
    In each case, the call now acts on a credential not a process, and as
    such no longer requires more complicated process locking/etc.  They
    now assume the caller will do any necessary allocation of an
    exclusive credential reference.  Each is commented to document its
    reference requirements.
  o CANSIGIO() is simplified to require only credentials, not processes
    and pcreds.
  o Remove lots of (p_pcred==NULL) checks.
  o Add an XXX to authorization code in nfs_lock.c, since it's
    questionable, and needs to be considered carefully.
  o Simplify posix4 authorization code to require only credentials, not
    processes and pcreds.  Note that this authorization, as well as
    CANSIGIO(), needs to be updated to use the p_cansignal() and
    p_cansched() centralized authorization routines, as they currently
    do not take into account some desirable restrictions that are handled
    by the centralized routines, as well as being inconsistent with other
    similar authorization instances.
  o Update libkvm to take these changes into account.
  
  Obtained from:	TrustedBSD Project
  Reviewed by:	green, bde, jhb, freebsd-arch, freebsd-audit
  
  Revision  Changes    Path
  1.36      +6 -8      src/lib/libkvm/kvm_proc.c
  1.14      +31 -18    src/sys/alpha/osf1/osf1_misc.c
  1.28      +6 -6      src/sys/compat/linprocfs/linprocfs_misc.c
  1.25      +2 -2      src/sys/compat/linprocfs/linprocfs_vnops.c
  1.102     +14 -12    src/sys/compat/linux/linux_misc.c
  1.31      +4 -9      src/sys/compat/svr4/svr4_misc.c
  1.21      +5 -5      src/sys/compat/svr4/svr4_sysvec.c
  1.23      +2 -2      src/sys/ddb/db_ps.c
  1.31      +4 -4      src/sys/fs/procfs/procfs_status.c
  1.98      +3 -4      src/sys/fs/procfs/procfs_vnops.c
  1.81      +5 -5      src/sys/i386/linux/linux_sysvec.c
  1.172     +3 -6      src/sys/kern/init_main.c
  1.34      +3 -3      src/sys/kern/kern_acct.c
  1.101     +1 -3      src/sys/kern/kern_descrip.c
  1.129     +47 -11    src/sys/kern/kern_exec.c
  1.128     +4 -8      src/sys/kern/kern_exit.c
  1.113     +4 -10     src/sys/kern/kern_fork.c
  1.53      +9 -9      src/sys/kern/kern_ktrace.c
  1.94      +10 -10    src/sys/kern/kern_proc.c
  1.91      +271 -180  src/sys/kern/kern_prot.c
  1.120     +12 -13    src/sys/kern/kern_sig.c
  1.66      +3 -3      src/sys/kern/uipc_usrreq.c
  1.193     +6 -6      src/sys/kern/vfs_syscalls.c
  1.5       +5 -3      src/sys/nfs/nfs_lock.c
  1.10      +11 -10    src/sys/posix4/p1003_1b.c
  1.27      +1 -2      src/sys/sys/filedesc.h
  1.164     +2 -20     src/sys/sys/proc.h
  1.24      +13 -4     src/sys/sys/ucred.h
  1.32      +3 -3      src/sys/ufs/ufs/ufs_extattr.c
  1.26      +3 -3      src/sys/ufs/ufs/ufs_vfsops.c


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105251659.f4PGxCm49043>