From owner-cvs-all@FreeBSD.ORG Sat Jul 8 19:51:38 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 938D416A4DA; Sat, 8 Jul 2006 19:51:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DD8B43D46; Sat, 8 Jul 2006 19:51:38 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k68JpcS3085263; Sat, 8 Jul 2006 19:51:38 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k68Jpcfm085262; Sat, 8 Jul 2006 19:51:38 GMT (envelope-from jhb) Message-Id: <200607081951.k68Jpcfm085262@repoman.freebsd.org> From: John Baldwin Date: Sat, 8 Jul 2006 19:51:38 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: 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 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jul 2006 19:51:38 -0000 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