From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 26 19:38:02 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2955C16A4CF for ; Fri, 26 Nov 2004 19:38:02 +0000 (GMT) Received: from sendmail.metro.cx (sonolo.xs4all.nl [80.126.206.91]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64B0D43D31 for ; Fri, 26 Nov 2004 19:38:01 +0000 (GMT) (envelope-from fbsd@metro.cx) Received: from dave.dh.sono (dave.dh.sono [10.1.2.5]) by sendmail.metro.cx (8.13.1/8.13.1) with ESMTP id iAQJc0NT070202 for ; Fri, 26 Nov 2004 19:38:00 GMT Received-SPF: none (sendmail.metro.cx: 10.1.2.5 is neither permitted nor denied by domain of metro.cx>) client-ip=10.1.2.5; envelope-from=; helo=dave.dh.sono; Received: from dave.dh.sono (localhost [127.0.0.1]) by dave.dh.sono (8.12.9-20030917/8.12.9) with ESMTP id iAQJc0dS011806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 26 Nov 2004 20:38:00 +0100 Received: (from gmc@localhost) by dave.dh.sono (8.12.9-20030917/8.12.9/Submit) id iAQJc0nk011805 for freebsd-hackers@freebsd.org; Fri, 26 Nov 2004 20:38:00 +0100 X-Authentication-Warning: dave.dh.sono: gmc set sender to fbsd@metro.cx using -f Date: Fri, 26 Nov 2004 20:38:00 +0100 From: Koen Martens To: freebsd-hackers@freebsd.org Message-ID: <20041126193800.GB11747@metro.cx> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rJwd6BRFiFCcLxzm" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-PGP-Key: http://www.metro.cx/pubkey-gmc.asc X-Helo-Milter-Helo: dave.dh.sono X-Helo-Milter-Hostname: dave.dh.sono X-Helo-Milter-Ip: 10.1.2.5 Subject: Jail + sysv shmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2004 19:38:02 -0000 --rJwd6BRFiFCcLxzm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Hackers, For a while i've been wanting shared memory to be usable withing jails, but with cross-jail protection. Ie. shared memory is restricted to a jail.=20 Recently I've been digging a bit in the freebsd kernel source code (which is new to me, been doing quite some linux kernel hacking though). It looks like this is actually not _that_ difficult to implement.=20 So, did anyone try this yet? Any pointers? I think it can be done by putting the jail id in struct ipc_perm (in sys/ipc.h), and then basically editing sysv_{msg,sem,shm}.c to extend these checks that are all over there: if (!jail_sysvipc_allowed && jailed(td->td_ucred)) return (ENOSYS); Does that sound ok? Kind regards, Koen --=20 K.F.J. Martens, Sonologic, http://www.sonologic.nl/ Networking, embedded systems, unix expertise, artificial intelligence. Public PGP key: http://www.metro.cx/pubkey-gmc.asc Wondering about the funny attachment your mail program can't read? Visit http://www.openpgp.org/ --rJwd6BRFiFCcLxzm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBp4YXktDgRrkFPpYRAqb6AJ9J3Kak1sSOrgOM3TmKOE/fQ3AOUACguWGr qSJnuFD2ViN7nhgrSMAfbdQ= =j4mc -----END PGP SIGNATURE----- --rJwd6BRFiFCcLxzm--