cvs commit: src/sys/compat/linux linux_ipc.c src/sys/compat/svr4 svr4_ipc.c src/sys/kern sysv_sem.c src/sys/sys syscallsubr.h

John Baldwin jhb at FreeBSD.org
Sat Jul 8 19:51:38 UTC 2006


jhb         2006-07-08 19:51:38 UTC

  FreeBSD src repository

  Modified files:
    sys/compat/linux     linux_ipc.c 
    sys/compat/svr4      svr4_ipc.c 
    sys/kern             sysv_sem.c 
    sys/sys              syscallsubr.h 
  Log:
  Rework kern_semctl a bit to always assume the UIO_SYSSPACE case.  This
  mostly consists of pushing a few copyin's and copyout's up into
  __semctl() as all the other callers were already doing the UIO_SYSSPACE
  case.  This also changes kern_semctl() to set the return value in a passed
  in pointer to a register_t rather than td->td_retval[0] directly so that
  callers can only set td->td_retval[0] if all the various copyout's succeed.
  
  As a result of these changes, kern_semctl() no longer does copyin/copyout
  (except for GETALL/SETALL) so simplify the locking to acquire the semakptr
  mutex before the MAC check and hold it all the way until the end of the
  big switch statement.  The GETALL/SETALL cases have to temporarily drop it
  while they do copyin/malloc and copyout.  Also, simplify the SETALL case to
  remove handling for a non-existent race condition.
  
  Revision  Changes    Path
  1.48      +12 -11    src/sys/compat/linux/linux_ipc.c
  1.23      +12 -8     src/sys/compat/svr4/svr4_ipc.c
  1.82      +87 -84    src/sys/kern/sysv_sem.c
  1.40      +1 -1      src/sys/sys/syscallsubr.h


More information about the cvs-src mailing list