From owner-cvs-all@FreeBSD.ORG Mon May 14 22:40:05 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3DFF16A403; Mon, 14 May 2007 22:40:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id D449713C448; Mon, 14 May 2007 22:40:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l4EMe5bB047224; Mon, 14 May 2007 22:40:05 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l4EMe5aP047194; Mon, 14 May 2007 22:40:05 GMT (envelope-from jhb) Message-Id: <200705142240.l4EMe5aP047194@repoman.freebsd.org> From: John Baldwin Date: Mon, 14 May 2007 22:40:04 +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/amd64/linux32 linux32_sysvec.c src/sys/compat/ia32 ia32_sysvec.c src/sys/kern imgact_elf.c kern_exec.c kern_resource.c src/sys/sys sysent.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: Mon, 14 May 2007 22:40:06 -0000 jhb 2007-05-14 22:40:04 UTC FreeBSD src repository Modified files: sys/amd64/linux32 linux32_sysvec.c sys/compat/ia32 ia32_sysvec.c sys/kern imgact_elf.c kern_exec.c kern_resource.c sys/sys sysent.h Log: Rework the support for ABIs to override resource limits (used by 32-bit processes under 64-bit kernels). Previously, each 32-bit process overwrote its resource limits at exec() time. The problem with this approach is that the new limits affect all child processes of the 32-bit process, including if the child process forks and execs a 64-bit process. To fix this, don't ovewrite the resource limits during exec(). Instead, sv_fixlimits() is now replaced with a different function sv_fixlimit() which asks the ABI to sanitize a single resource limit. We then use this when querying and setting resource limits. Thus, if a 32-bit process sets a limit, then that new limit will be inherited by future children. However, if the 32-bit process doesn't change a limit, then a future 64-bit child will see the "full" 64-bit limit rather than the 32-bit limit. MFC is tentative since it will break the ABI of old linux.ko modules (no other modules are affected). MFC after: 1 week Revision Changes Path 1.29 +28 -34 src/sys/amd64/linux32/linux32_sysvec.c 1.24 +28 -30 src/sys/compat/ia32/ia32_sysvec.c 1.178 +1 -1 src/sys/kern/imgact_elf.c 1.303 +0 -9 src/sys/kern/kern_exec.c 1.170 +4 -6 src/sys/kern/kern_resource.c 1.54 +2 -2 src/sys/sys/sysent.h