Date: Sat, 8 Jul 2006 19:51:38 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: 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 Message-ID: <200607081951.k68Jpcfm085262@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607081951.k68Jpcfm085262>