Jail & SYSVIPC & postgres

From: Marton Kenyeres (mkenyeres@konvergencia.hu)
Date: 12/24/02


Date: Tue, 24 Dec 2002 09:51:12 +0100
From: Marton Kenyeres <mkenyeres@konvergencia.hu>
To: security@freebsd.org

Hi!

I'm in a middle of building a server which will run Apache + PHP + Postgresql
along with a few basic services as DNS, SMTP and POP3. I plan to put the
web-related services, the e-mail related services and BIND in 3 separate
jail-s. Unfortunately PostgreSQL depends heavily on shared memory, so if I
plan to use it in a jail i have to turn the jail.sysvipc_allowed sysctl on.

One more addition: the jails are bind to aliases on the loopback interface
and the connections are NAT-ed to the outer interface. The main benefit of
this (apart from not paying $$-s for additional IP-addresses :) is that
no service runs as root as they don't have to bind to their usual priviledged
ports.

From the developers handbook:

"On most systems, this sysctl is set to 0. If it were set to 1, it would
defeat the whole purpose of having a jail; privleged users from within the jail
would be able to affect processes outside of the environment. "

My question is:

Do I really shoot myself in the foot with allowing SYSVIPC in the jails,
if there are absolutely no processes runing as root inside the jails, nor
there are any suid programs ?

Any help, advice etc. greatly appreciated,

cheerz:
m.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message



Relevant Pages

  • Re: jail + postgresql + System V IPC
    ... > I have resently installed a jail environment on my freebsd box, ... > problems getting postgresql running under it. ... shared memory and semaphores exist only ...
    (freebsd-stable)
  • Multiple PostgreSQL 8.4 instances in FreeBSD 8.0 RC2 Jails
    ... I want to setup 5 postgreSQL 8.4 servers in separate jails on a amd64 ... FreeBSD 8.0 RC2 machine ... is with FreeBSD 5.x's jail side of things, ...
    (freebsd-questions)
  • Re: [HACKERS] semaphore usage "port based"?
    ... If you're in a jail, ... not another process is running when it tries to allocate a semaphore ... ... altho the jail issuing the kill can't see that ... process, so postgresql would go on to 54320002, and test that ... ...
    (freebsd-stable)
  • jail + postgresql + System V IPC
    ... I have resently installed a jail environment on my freebsd box, ... problems getting postgresql running under it. ... After looking a bit on various mailinglists i figured out that I needed to ...
    (freebsd-stable)
  • Re: [HACKERS] semaphore usage "port based"?
    ... wouldn't want to be able to SIGKILL the process from a different jail, ... The problem is that PostgreSQL uses killto determine whether or not another process is running when it tries to allocate a semaphore ... ... Robert brought up a good point, about recycled PIDs, but Tom Lane's response to that about the fact that we don't care if the process that is running is the one *actually* holding the semaphore, we'd rather err on the side of caution and just move on ... ...
    (freebsd-stable)

Quantcast