Req #80657 [NEW]: Linux namespace support
| From: | martynas at martynas dot it | Date: | Fri, 22 Jan 2021 09:39:39 +0000 |
| Subject: | Req #80657 [NEW]: Linux namespace support | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-231698@lists.php.net to get a copy of this message | ||
From: martynas at martynas dot it
Operating system: Linux
PHP version: Next Minor Version
Package: FPM related
Bug Type: Feature/Change Request
Bug description:Linux namespace support
Description:
------------
Current chroot implementation was okay to use years ago, even if it had
its own drawbacks.
Things are changing, and it'd be awesome to have linux mount namespaces
for the isolation (and maybe some other namespaces).
https://github.com/containers/bubblewrap is a
nice example.
By using mount namespace + pivot_root after
(https://linux.die.net/man/8/pivot_root, mntent.h include from glibc)
full paths wouldn't change for the applications, as user homedir (for
example /home/user), could be still mounted as /home/user in linux
namespace).
In addition to this, /etc/passwd could store just the user details
needed.
clone() with CLONE_NEWNS would need to be used instead of fork():
https://linux.die.net/man/2/clone
getpid() would need to be replaced with syscall(__NR_getpid) where it's
used, because old glibc wrapper for getpid() returns a cached pid
invalidated only by fork() calls.
It'd be nice to have it as extensive as
https://github.com/containers/bubblewrap/blob/master/demos/bubblewrap-shell.sh
example (so that users could specify the environment needed), but a
basic implementation would still be way better to have than the current
chroot option.
--
Edit bug report at https://bugs.php.net/bug.php?id=80657&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80657&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80657&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80657&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80657&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80657&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80657&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80657&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80657&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80657&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80657&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80657&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80657&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80657&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80657&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80657&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80657&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80657&r=mysqlcfg