Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jun 2015 10:17:46 +0900
From:      <kikuchan@uranus.dti.ne.jp>
To:        <freebsd-jail@freebsd.org>, <freebsd-hackers@freebsd.org>
Subject:   How to implement jail-aware SysV IPC (with my nasty patch)
Message-ID:  <cc18282ebe394476120a139239225782@imap.cm.dream.jp>

next in thread | raw e-mail | index | archive | help
--=_63617d2f0e214e52d0427b5986ad3c29
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
 charset=iso-2022-jp

Hello,

I'm (still) trying to figure out how jail-aware SysV IPC mechanism should be.

I want to run PostgreSQL in each jail without changing UID for each jail.
If you don't change UID on each jail, it doesn't work due to IPC objects conflict between jails.
See also;
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=48471
  http://www.freebsddiary.org/jail-multiple.php
  https://wiki.freebsd.org/Jails
  https://forums.freebsd.org/threads/postgresql-in-jail.51528/

There is a patch for 4.7-STABLE on bugzilla (see above) to solve the problem by completely separating namespace for each jail in kernel,
but I couldn't find any (other) implementation that works on recent FreeBSD.
I've also tried to re-write the patch for recent FreeBSD, but I couldn't make it properly due to my limited kernel knowledge ;(

Anyway, I created (and update) a patch to trying to solve the problem by simply separating IPC key_t space for each jail.
The attached patch can be applied to 10-STABLE (or CURRENT?).

After the patch is applied;
- IPC objects created on parent jail, are invisible to children.
- IPC objects created on neighbor jail, are also invisible each other.
- IPC objects craeted on child jail, are VISIBLE from parent.
- IPC key_t spaces are separated between jails. If you see the key_t named object from parent, it's shown as IPC_PRIVATE.

I choose this design of feature, however, I'm not sure this is the right design for jail-aware IPC.
If you prefer the completely separated namespace approach, it's ok. I want to focus on how the IPC mechanism dealing with hierarchical jail system.

So I need more feedbacks. Could you help me please?
You can dig and play with ipcs(1)/ipcrm(1) to see what happend on each jail.

Thanks.

--
Kikuchan
--=_63617d2f0e214e52d0427b5986ad3c29
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
 name=jailed-sysvipc-for-stable10-again.patch;
 charset=U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aWQgKCpzaG1mb3JrX2hvb2sp
KHN0cnVjdCBwcm9jICosIHN0cnVjdCBwcm9jICopOwogZXh0ZXJuIHZvaWQgKCpzaG1leGl0X2hv
b2spKHN0cnVjdCB2bXNwYWNlICopOworZXh0ZXJuIHZvaWQgKCpzeXN2c2htX2NsZWFudXBfZm9y
X3ByaXNvbl9ob29rKShzdHJ1Y3QgcHJpc29uICopOworZXh0ZXJuIHZvaWQgKCpzeXN2bXNnX2Ns
ZWFudXBfZm9yX3ByaXNvbl9ob29rKShzdHJ1Y3QgcHJpc29uICopOworZXh0ZXJuIHZvaWQgKCpz
eXN2c2VtX2NsZWFudXBfZm9yX3ByaXNvbl9ob29rKShzdHJ1Y3QgcHJpc29uICopOwogCiAjZWxz
ZSAvKiAhIF9LRVJORUwgKi8KIAo=
--=_63617d2f0e214e52d0427b5986ad3c29--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cc18282ebe394476120a139239225782>