Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2000 15:27:17 -0700 (PDT)
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/kern init_main.c kern_exit.c kern_fork.c kern_proc.c kern_prot.c uipc_socket.c uipc_socket2.c uipc_usrreq.c src/sys/svr4 svr4_misc.c src/sys/sys proc.h
Message-ID:  <200006222227.PAA81776@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
alfred      2000/06/22 15:27:17 PDT

  Modified files:
    sys/kern             init_main.c kern_exit.c kern_fork.c 
                         kern_proc.c kern_prot.c uipc_socket.c 
                         uipc_socket2.c uipc_usrreq.c 
    sys/svr4             svr4_misc.c 
    sys/sys              proc.h 
  Log:
  fix races in the uidinfo subsystem, several problems existed:
  
  1) while allocating a uidinfo struct malloc is called with M_WAITOK,
     it's possible that while asleep another process by the same user
     could have woken up earlier and inserted an entry into the uid
     hash table.  Having redundant entries causes inconsistancies that
     we can't handle.
  
     fix: do a non-waiting malloc, and if that fails then do a blocking
     malloc, after waking up check that no one else has inserted an entry
     for us already.
  
  2) Because many checks for sbsize were done as "test then set" in a non
     atomic manner it was possible to exceed the limits put up via races.
  
     fix: instead of querying the count then setting, we just attempt to
     set the count and leave it up to the function to return success or
     failure.
  
  3) The uidinfo code was inlining and repeating, lookups and insertions
     and deletions needed to be in their own functions for clarity.
  
  Reviewed by: green
  
  Revision  Changes    Path
  1.135     +2 -2      src/sys/kern/init_main.c
  1.98      +2 -2      src/sys/kern/kern_exit.c
  1.76      +4 -5      src/sys/kern/kern_fork.c
  1.66      +92 -54    src/sys/kern/kern_proc.c
  1.59      +7 -7      src/sys/kern/kern_prot.c
  1.78      +3 -3      src/sys/kern/uipc_socket.c
  1.60      +5 -5      src/sys/kern/uipc_socket2.c
  1.55      +4 -3      src/sys/kern/uipc_usrreq.c
  1.15      +2 -2      src/sys/svr4/svr4_misc.c
  1.106     +3 -3      src/sys/sys/proc.h



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?200006222227.PAA81776>