New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bubblewrap Sandboxed Tor Browser fails to start in Qubes Debian based AppVM - firefox: Can't mount proc on /newroot/proc #2540

Open
adrelanos opened this Issue Dec 25, 2016 · 12 comments

Comments

Projects
None yet
4 participants
@adrelanos
Member

adrelanos commented Dec 25, 2016

Qubes OS version (e.g., R3.2):

R3.2 with Qubes testing repository

Affected TemplateVMs (e.g., fedora-23, if applicable):

debian, whonix-ws


Expected behavior:

sandboxed-tor-browser working.

Actual behavior:

sandboxed-tor-browser fails to start.

2016/12/25 05:35:20 firefox: Can't mount proc on /newroot/proc
2016/12/25 05:35:20 firefox: : Operation not permitted
2016/12/25 05:35:20 fatal error in the user interface: waitid: no child processes

Steps to reproduce the behavior:

  1. Boot a Debian jessie TemplateVM.

  2. Enable jessie-backports.

sudo su -c "echo -e 'deb http://http.debian.net/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list"
  1. Consider using apt pinning.

  2. Install dependencies from jessie-backports.

sudo apt-get -t jessie-backports install golang bubblewrap libseccomp2 libseccomp-dev
  1. Shut down the TemplateVM and start a Debian based AppVM.

  2. Download and unzip Sandboxed Tor Browser.

Download links can be found here (scroll down to Tor Browser Sandbox):
https://www.torproject.org/projects/torbrowser.html.en#downloads-alpha

For your convenience:

  • wget https://www.torproject.org/dist/torbrowser/6.5a6/sandbox-0.0.2-linux64.zip
  • wget https://www.torproject.org/dist/torbrowser/6.5a6/sandbox-0.0.2-linux64.zip.asc
  • gpg --recv-keys "EF6E 286D DA85 EA2A 4BA7 DE68 4E2C 6E87 9329 8290"
  • gpg --verify sandbox-0.0.2-linux64.zip.asc
  • unzip sandbox-0.0.2-linux64.zip
  1. start
./sandboxed-tor-browser

choose hardened Tor Browser.

General notes:

Sandboxed Tor Browser works for me with the same instructions inside a Non-Qubes Debian jessie VirtualBox VM.

Debug output:

Full output of ./sandboxed-tor-browser -debug can be found here:
https://trac.torproject.org/projects/tor/ticket/2107


Related issues:

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 25, 2016

Member
Member

marmarek commented Dec 25, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 25, 2016

Member

Apparmor, yes.

Member

adrelanos commented Dec 25, 2016

Apparmor, yes.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 25, 2016

Member
Member

marmarek commented Dec 25, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 25, 2016

Member

Just now finished testing with apparmor removed kernel command line. (Verified using sudo aa-status.) Didn't fix this.


Member

adrelanos commented Dec 25, 2016

Just now finished testing with apparmor removed kernel command line. (Verified using sudo aa-status.) Didn't fix this.


@adrelanos adrelanos referenced this issue in projectatomic/bubblewrap Dec 26, 2016

Open

breaks with /proc/xen mounted (QubesOS) #134

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 26, 2016

Member

Also tested this also in a Qubes Debian stretch VM (upgrades a jessie template to stretch). Didn't fix this issue.

Also thought perhaps the kernel provided by dom0 might be incompatible with bubblewrap. To rule that out I switched that Qubes Debian stretch VM to Debian stretch linux-image-amd64 using Qubes VM kernel / pvgrub. Didn't fix this issue either.

Also asked the bubblewrap maintainers for any insights:
projectatomic/bubblewrap#134

Member

adrelanos commented Dec 26, 2016

Also tested this also in a Qubes Debian stretch VM (upgrades a jessie template to stretch). Didn't fix this issue.

Also thought perhaps the kernel provided by dom0 might be incompatible with bubblewrap. To rule that out I switched that Qubes Debian stretch VM to Debian stretch linux-image-amd64 using Qubes VM kernel / pvgrub. Didn't fix this issue either.

Also asked the bubblewrap maintainers for any insights:
projectatomic/bubblewrap#134

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jan 11, 2017

Member

Quote @marmarek projectatomic/bubblewrap#134 (comment):

Indeed after unmounting /proc/xen it does work. I wonder if anything still use /proc/xen in Qubes... AFAIR it's legacy location and the new one is /dev/xen. There were more problems with /proc/xen (where "normal files" behaves like character devices...). The fact that I could unmount it without killing anything suggests it isn't used anymore :)

That is great news!

/dev/xen is hardcoded a few times in multiple Qubes packages. Would solving this ticket now mean to change any mention of /dev/xen to /proc/xen? If so, should I create the pull requests to change this?

Member

adrelanos commented Jan 11, 2017

Quote @marmarek projectatomic/bubblewrap#134 (comment):

Indeed after unmounting /proc/xen it does work. I wonder if anything still use /proc/xen in Qubes... AFAIR it's legacy location and the new one is /dev/xen. There were more problems with /proc/xen (where "normal files" behaves like character devices...). The fact that I could unmount it without killing anything suggests it isn't used anymore :)

That is great news!

/dev/xen is hardcoded a few times in multiple Qubes packages. Would solving this ticket now mean to change any mention of /dev/xen to /proc/xen? If so, should I create the pull requests to change this?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 11, 2017

Member

Would solving this ticket now mean to change any mention of /dev/xen to /proc/xen?

The other way around.
The great thing about /dev/xen is that it don't require to be specifically mounted (but still you require some modules being loaded) - so one potential race condition less.

Member

marmarek commented Jan 11, 2017

Would solving this ticket now mean to change any mention of /dev/xen to /proc/xen?

The other way around.
The great thing about /dev/xen is that it don't require to be specifically mounted (but still you require some modules being loaded) - so one potential race condition less.

adrelanos added a commit to adrelanos/qubes-builder-debian that referenced this issue Jan 11, 2017

@adrelanos adrelanos referenced this issue in marmarek/qubes-builder-debian Jan 11, 2017

Closed

/proc/xen -> /dev/xen #27

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jan 11, 2017

Member

Here is the first PR.

marmarek/qubes-builder-debian#27

Does it look alright? If so, I would be going forward with the other components.

Member

adrelanos commented Jan 11, 2017

Here is the first PR.

marmarek/qubes-builder-debian#27

Does it look alright? If so, I would be going forward with the other components.

adrelanos added a commit to adrelanos/qubes-builder-debian that referenced this issue Jan 12, 2017

@adrelanos adrelanos referenced this issue in marmarek/qubes-builder-debian Jan 12, 2017

Closed

no longer mount /proc/xen since not needed #28

adrelanos added a commit to adrelanos/qubes-vmm-xen that referenced this issue Jan 12, 2017

adrelanos added a commit to adrelanos/qubes-vmm-xen that referenced this issue Jan 12, 2017

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jan 12, 2017

Member

Actually, not as simple as a search, replace and pull request action as I thought. ( marmarek/qubes-builder-debian#27 / marmarek/qubes-builder-debian#28 )

Member

adrelanos commented Jan 12, 2017

Actually, not as simple as a search, replace and pull request action as I thought. ( marmarek/qubes-builder-debian#27 / marmarek/qubes-builder-debian#28 )

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 12, 2017

Member

Just tested - mostly works. The only problem I've found is missing /proc/xen/capabilities, which don't have corresponding file in /dev/xen. It's used here for checking if running in dom0 or VM. And probably few more places for the same purpose.

I'm looking at /sys/hypervisor/properties/features, where 0x800 bit is missing in VM (compared to the same in dom0). In theory it's XENFEAT_dom0, but it's described as "operation as Dom0 is supported" - so, not necessary running as dom0 (at least this is my understanding). Looking at the code setting this flag, it's totally not obvious if this is the same.

Member

marmarek commented Jan 12, 2017

Just tested - mostly works. The only problem I've found is missing /proc/xen/capabilities, which don't have corresponding file in /dev/xen. It's used here for checking if running in dom0 or VM. And probably few more places for the same purpose.

I'm looking at /sys/hypervisor/properties/features, where 0x800 bit is missing in VM (compared to the same in dom0). In theory it's XENFEAT_dom0, but it's described as "operation as Dom0 is supported" - so, not necessary running as dom0 (at least this is my understanding). Looking at the code setting this flag, it's totally not obvious if this is the same.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jan 12, 2017

Member
Member

adrelanos commented Jan 12, 2017

@alex-mazzariol

This comment has been minimized.

Show comment
Hide comment
@alex-mazzariol

alex-mazzariol Feb 10, 2017

This issue affects a lot of flatpak-distributed software (i.e. MonoDevelop), not only sandboxed TOR browser. It seems that flatpak internally uses bubblewrap too.

This issue affects a lot of flatpak-distributed software (i.e. MonoDevelop), not only sandboxed TOR browser. It seems that flatpak internally uses bubblewrap too.

@marmarek marmarek referenced this issue in QubesOS/qubes-linux-utils Nov 8, 2017

Merged

Speed up udev-block-add-change by not using xenstore #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment