From owner-freebsd-stable@FreeBSD.ORG Mon Apr 3 18:50:50 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7971A16A400; Mon, 3 Apr 2006 18:50:50 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id C784F43D53; Mon, 3 Apr 2006 18:50:49 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail05.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k33Iolfc022187 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 4 Apr 2006 04:50:48 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.4/8.13.4) with ESMTP id k33IolYI002879; Tue, 4 Apr 2006 04:50:47 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.4/8.13.4/Submit) id k33IolhS002878; Tue, 4 Apr 2006 04:50:47 +1000 (EST) (envelope-from peter) Date: Tue, 4 Apr 2006 04:50:47 +1000 From: Peter Jeremy To: Daniel Eischen Message-ID: <20060403185046.GC683@turion.vk2pj.dyndns.org> References: <20060403043711.GB76193@heff.fud.org.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: freebsd-stable@freebsd.org Subject: Re: [HACKERS] semaphore usage "port based"? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2006 18:50:50 -0000 On Mon, 2006-Apr-03 08:19:00 -0400, Daniel Eischen wrote: >I don't really see what the problem is. ESRCH seems perfectly >reasonable for trying to kill (even sig 0) a process from a >different jail. If you're in a jail, then you shouldn't have >knowledge of processes from other jails. I agree in general. The problem here is that SysV IPC isn't jail-aware - there's a single SysV IPC address space across the physical system. This confuses (eg) postgres because it can see the SHM for a postgres instance in another jail but kill(2) claims that the process associated with that SHM doesn't exist. There appear to be two solutions: 1) Add a sysctl to change cr_cansignal() and/or prison_check() to make processes visible between jails. 2) Change SysV IPC to be jail-aware. The former is trivial - but has a number of security implications. The latter is much harder, there is apparently a RELENG_4 patch in kern/48471 but it's not clear how much work would be necessary to being it up to scratch. -- Peter Jeremy