Commit 2f55bae
bubblewrap: Add
Some callers of bwrap (e.g. xdg-dbus-proxy, Steam Runtime) use it purely
to adjust filesystem layout, without any expectation of a security
boundary between the sandbox and the host.
For these callers, hard failures during sandbox setup (such as
a subdirectory remount failing because an automounter did not respond in
time) are unnecessarily fatal.
So add a new `--not-a-security-boundary` option that can be used to
relax the bubblewrap behavior in these specific cases, and allow it to
"fail-open".
The behavior can be tested by setting up an unavailable automount and
check that:
1. bubblewrap succeeds even when accessing the unavailable automount
fails;
2. remount flags like `nosuid,nodev` are not applied to the unavailable
automount.
```
$ sudo sh -c 'echo "UUID=00000000-0000-0000-0000-000000000000 /mnt/bad ext4 defaults,noatime,nofail,inode_readahead_blks=64,nobarrier,x-systemd.automount 0 1" >> /etc/fstab'
$ sudo systemctl daemon-reload
$ sudo systemctl restart mnt-bad.automount
$ mount | grep /mnt/bad
systemd-1 on /mnt/bad type autofs (rw,relatime,fd=76,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=15854)
$ ls /mnt/bad &>/dev/null &
$ ./_build/bwrap --not-a-security-boundary --bind / / grep /mnt /proc/self/mountinfo
bwrap: Can't remount /newroot/mnt/bad submount (No such device), ignoring error
860 769 0:41 / /mnt/bad rw,relatime master:45 - autofs systemd-1 rw,fd=107,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=144522
```
steamrt/tasks#535
Resolves: #653
Helps: flatpak/flatpak#5112
Helps: ValveSoftware/steam-for-linux#10571
Helps: ValveSoftware/steam-runtime#766
Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>--not-a-security-boundary flag to enable fail-open behavior1 parent 3d8b666 commit 2f55bae
5 files changed
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
479 | 488 | | |
480 | 489 | | |
481 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
| 354 | + | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
1005 | 1008 | | |
1006 | 1009 | | |
1007 | 1010 | | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1008 | 1014 | | |
1009 | 1015 | | |
1010 | 1016 | | |
| |||
2433 | 2439 | | |
2434 | 2440 | | |
2435 | 2441 | | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
2436 | 2446 | | |
2437 | 2447 | | |
2438 | 2448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
617 | 649 | | |
618 | 650 | | |
619 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
692 | 701 | | |
0 commit comments