|
23 | 23 | <link rel="apple-touch-icon" href="/favicon.ico"> |
24 | 24 | <link rel="stylesheet" href="/assets/css/site.css?v=b310d7c992"> |
25 | 25 | <link rel="stylesheet" href="/assets/css/main.css?v=ccd72260b9"> |
26 | | - <script type="application/ld+json">[{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Feature deep dives", "description": "How each Droidspaces feature works: namespace isolation, init system support, OverlayFS volatile mode, GPU acceleration, cgroup isolation, seccomp shields, and Android-specific tuning.", "url": "https://www.droidspaces.org/docs/features.html", "inLanguage": "en", "dateModified": "2026-09-28", "author": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "publisher": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "isPartOf": {"@type": "WebSite", "name": "Droidspaces", "url": "https://www.droidspaces.org/"}}, {"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://www.droidspaces.org/"}, {"@type": "ListItem", "position": 2, "name": "Documentation", "item": "https://www.droidspaces.org/docs/"}, {"@type": "ListItem", "position": 3, "name": "Feature deep dives", "item": "https://www.droidspaces.org/docs/features.html"}]}]</script> |
| 26 | + <script type="application/ld+json">[{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Feature deep dives", "description": "How each Droidspaces feature works: namespace isolation, init system support, OverlayFS volatile mode, GPU acceleration, cgroup isolation, seccomp shields, and Android-specific tuning.", "url": "https://www.droidspaces.org/docs/features.html", "inLanguage": "en", "dateModified": "2026-10-01", "author": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "publisher": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "isPartOf": {"@type": "WebSite", "name": "Droidspaces", "url": "https://www.droidspaces.org/"}}, {"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://www.droidspaces.org/"}, {"@type": "ListItem", "position": 2, "name": "Documentation", "item": "https://www.droidspaces.org/docs/"}, {"@type": "ListItem", "position": 3, "name": "Feature deep dives", "item": "https://www.droidspaces.org/docs/features.html"}]}]</script> |
27 | 27 | <script>(function(){const t=localStorage.getItem('theme');if(t)document.documentElement.setAttribute('data-theme',t);})();</script> |
28 | 28 | </head> |
29 | 29 | <body> |
@@ -467,10 +467,11 @@ <h3 id="what-it-changes">What it changes <a class="header-anchor" href="#what-it |
467 | 467 | <ol> |
468 | 468 | <li><strong>User namespaces are allowed.</strong> The seccomp filter stops returning <code>EPERM</code> for <code>unshare(CLONE_NEWUSER)</code> and <code>clone(CLONE_NEWUSER)</code>, and <code>clone3</code> is no longer hidden.</li> |
469 | 469 | <li><strong>A pristine <code>proc</code> and a read-only <code>sysfs</code> are mounted under <code>/run/droidspaces/</code>.</strong> The kernel lets a child user namespace mount <code>proc</code> or <code>sysfs</code> only if some instance of that filesystem in the mount namespace is "fully visible": the root of the filesystem, nothing bind-mounted over a real file inside it, and not read-only when the new mount is read-write. The container's own <code>/proc</code> and <code>/sys</code> never qualify, because the jail masks and the virtualized <code>uptime</code>, <code>loadavg</code>, <code>meminfo</code> and friends are exactly such bind mounts. Any instance anywhere satisfies the rule, so Droidspaces adds one out of the way. LXC does the same in <code>nesting.conf</code> with <code>/dev/.lxc/proc</code> and <code>/dev/.lxc/sys</code>. The masks and the virtualized files stay where they were.</li> |
| 470 | +<li><strong><code>/proc/sys/user</code> is writable.</strong> bwrap with <code>--disable-userns</code>, which is how Flatpak launches apps, writes <code>user.max_user_namespaces</code> through the container's own <code>/proc</code> before it unshares its second user namespace. So that subtree joins <code>net</code>, <code>hostname</code> and <code>domainname</code> as a read-write hole in the otherwise read-only <code>/proc/sys</code>.</li> |
470 | 471 | <li><strong><code>CAP_SYS_PTRACE</code> stays in the bounding set.</strong> runc opens <code>/proc/<pid>/ns/net</code> and <code>/proc/<pid>/ns/mnt</code> of a container init that has already switched to the remapped uid, and root only gets that read on another uid's process through this capability.</li> |
471 | 472 | </ol> |
472 | 473 | <h3 id="what-it-costs">What it costs <a class="header-anchor" href="#what-it-costs">#</a></h3> |
473 | | -<p>The pristine <code>proc</code> has to be writable and unmasked, or the kernel would not count it. So <code>/run/droidspaces/proc/sys/</code> is the live host sysctl tree and <code>/run/droidspaces/proc/sysrq-trigger</code> is real. Nothing writes there by accident, <code>/proc/sys</code> at its normal path is still read-only, but root in the container can reach it on purpose. Treat the toggle as trusting the container's root user. The <code>sysfs</code> copy is read-only and exposes nothing new.</p> |
| 474 | +<p>The pristine <code>proc</code> has to be writable and unmasked, or the kernel would not count it. So <code>/run/droidspaces/proc/sys/</code> is the live host sysctl tree and <code>/run/droidspaces/proc/sysrq-trigger</code> is real. Nothing writes there by accident, <code>/proc/sys</code> at its normal path is still read-only, but root in the container can reach it on purpose. The one exception is <code>/proc/sys/user</code>. Those sysctls belong to the user namespace of the writer, and the container shares the host's, so a <code>user.max_user_namespaces = 0</code> line in the container's <code>sysctl.d</code> lands on the host at boot and switches user namespaces off for every other sandboxing container until the device reboots. Treat the toggle as trusting the container's root user. The <code>sysfs</code> copy is read-only and exposes nothing new.</p> |
474 | 475 | <h3 id="usage-3">Usage <a class="header-anchor" href="#usage-3">#</a></h3> |
475 | 476 | <div class="code-block"><span class="code-lang">bash</span><button class="icon-button copy-btn" onclick="copyCode(this)" aria-label="Copy"><span class="icon" aria-hidden="true">content_copy</span></button><pre><code>droidspaces<span class="w"> </span>--name<span class="o">=</span>mycontainer<span class="w"> </span>--rootfs<span class="o">=</span>/path/to/rootfs<span class="w"> </span>--allow-sandboxing<span class="w"> </span>start |
476 | 477 | </code></pre></div> |
|
0 commit comments