Skip to contentSkip to conversation

ts-depriv-audit-qemu: Create complete /run/user in appropriate root

PATCH New Ian Jackson 1 participant 3 messages Nov 20, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 ts-depriv-audit-qemu: Create complete /run/user in appropriate root

* Use mkdir -p, rather than trying to only create /run/user/$uid. That helps if /run and/or /run/user do not exist, as they do in libxl-made chroots with recent libxl (which gets qemu to chroot).

* Do all of this in the root directory of the qemu process, not our own root directory. So it works if qemu is chrooted.

---
v2: Actually use $qpid rather than hardcoding 8123 !

squash! ts-depriv-audit-qemu: Create complete /run/user in appropriate root

---
 ts-depriv-audit-qemu | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
ts-depriv-audit-qemu +4 -3
index 5d093500..d5bf10c9 100755
@@ -48,9 +48,10 @@ END
         qpid=$(xenstore-read /local/domain/$domid/image/device-model-pid)
         uid=$(id -u xen-qemuuser-range-base)
         uid=$(( $uid + $domid ))
-        test -d /run/user || mkdir -m 2755 /run/user
-        if mkdir -m 2700 /run/user/$uid; then
-            chown $uid:root /run/user/$uid
+        qroot=$(readlink /proc/$qpid/root)
+        mkdir -pm 2755 $qroot/run/user
+        if mkdir -m 2700 $qroot/run/user/$uid; then
+            chown $uid:root $qroot/run/user/$uid
         fi
         osstest-depriv-fd-collector $qpid \
         /usr/local/lib/xen/bin/depriv-fd-checker
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH v2 2/3 ts-depriv-audit-qemu: chmod +x qemu's chroot

libxl creates this directory with mode 0. That prevents fishdescriptor from working. chmod it. This is OK for testing.

---
 ts-depriv-audit-qemu | 1 +
 1 file changed, 1 insertion(+)
ts-depriv-audit-qemu +1 -0
index d5bf10c9..599bdf6d 100755
@@ -49,6 +49,7 @@ END
         uid=$(id -u xen-qemuuser-range-base)
         uid=$(( $uid + $domid ))
         qroot=$(readlink /proc/$qpid/root)
+        chmod a+x $qroot
         mkdir -pm 2755 $qroot/run/user
         if mkdir -m 2700 $qroot/run/user/$uid; then
             chown $uid:root $qroot/run/user/$uid
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

PATCH v2 3/3 production-config*: Update to fishdescriptor with chroot bugfix

In reply to Ian Jackson

Deployment note: I have copied this binary to the images directory in Cambridge and Massachusetts. The corresponding patch to chiark-utils is on its way to my upstream hat.

---
 production-config           | 2 +-
 production-config-cambridge | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
production-config +1 -1
index df02cd37..6b743d4f 100644
@@ -103,7 +103,7 @@ MicrocodeUpdateI386 microcode.x86.2015-06-12.cpio
 # Update with ./mg-netgrub-loader-update
 TftpGrubVersion XXXX-XX-XX
 
-DebianExtraPackages_jessie chiark-scripts_6.0.2_all.deb
+DebianExtraPackages_jessie chiark-scripts_6.0.3~citrix1_all.deb
 
 DebianExtraPackages_uefi_i386_jessie   extradebs-uefi-i386-2018-04-01/
 DebianExtraPackages_uefi_amd64_jessie  extradebs-uefi-amd64-2018-04-01/
production-config-cambridge +1 -1
index 5c9a4a28..8e2eadd2 100644
@@ -82,7 +82,7 @@ TftpDiVersion_jessie 2018-06-26
 DebianImageVersion_wheezy 7.2.0
 DebianImageVersion_jessie 8.2.0
 
-DebianExtraPackages_jessie chiark-scripts_6.0.2_all.deb
+DebianExtraPackages_jessie chiark-scripts_6.0.3~citrix1_all.deb
 
 # These should normally be the same.
 MicrocodeUpdateAmd64 microcode.x86.2015-06-12.cpio
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel