Skip to content

[Bug]: cannot share all of /run with a Flatpak app #5207

Closed

Description

@monroth

Checklist

Flatpak version

1.12.4

What Linux distribution are you using?

Other (specify below)

Linux distribution version

Linux steamdeck 5.3.0-valve21.3-1-neptune

What architecture are you using?

x86_64

How to reproduce

Not sure exactly how this happened, as issue makes it difficult to debug, but I think steps were as follows

  1. Install Flatseal
  2. Use it to allow all flatpaks access to /run and some other folders (difficult to tell which because of issue)
  3. Probably reboot
  4. Try to launch any flatpak

Expected Behavior

I expected flatpak to start and have access to my filesystem

Actual Behavior

Flatpak did not launch with with terminal message

bwrap: Can't mkdir parents for /run/host/os-release: Permission denied

Additional Information

Issue #1357 might be related, but I searched symlinks for / via command

sudo find -maxdepth 1 -type l -ls

and find only 5 old symlinks in /usr and in /var, nothing new or in /run

Activity

  1. smcv commented on Dec 9, 2022

    @smcv
    Collaborator

    allow all flatpaks access to /run

    That can't work. Flatpak relies on the /run inside the container being a tmpfs under its control so that it can create /run/host, /run/flatpak and potentially others, which it will be unable to do if you change /run to be shared from the host system.

    Probably Flatpak should ignore --filesystem=/run, ideally with a warning, the same way it already ignores --filesystem=/usr.

    Instead of sharing /run with the host, share individual sockets in /run with the host (and try to do that as minimally as possible, because each socket you share is an extra route through which a malicious or compromised app might escape from the sandbox).

  2. changed the title [-][Bug]: [/-] [+][Bug]: cannot share all of /run with a Flatpak app[/+] on Dec 9, 2022
  3. smcv commented on Dec 9, 2022

    @smcv
    Collaborator

    Use it to allow all flatpaks access to /run and some other folders (difficult to tell which because of issue)

    Please include the full list of overrides in issue reports, particularly if you suspect the overrides are part of the reason for failure. You can see the overrides with:

    1. flatpak override --show --system
    2. flatpak override --show --system APP
    3. flatpak override --show --user
    4. flatpak override --show --user APP

    replacing APP with an app ID like org.gnome.Recipes. The first and third commands show overrides that apply to all apps, the second and fourth commands show overrides that are specific to one app. The first and second show overrides that apply to all users, the third and fourth show overrides that apply to you specifically.

    To remove overrides that are causing trouble, either use Flatseal, or you can remove all overrides with:

    1. sudo flatpak override --reset --system
    2. sudo flatpak override --reset --system APP
    3. flatpak override --reset --user
    4. flatpak override --reset --user APP

    Similar to the --show commands, the first and third commands remove overrides that apply to all apps, while the second and fourth commands remove overrides that are specific to one app. The first and second remove overrides that apply to all users, the third and fourth remove overrides that apply to you specifically. To remove all overrides, you would potentially need all four of these commands.

  4. monroth commented on Dec 9, 2022

    @monroth
    Author

    yes, there were /run in overrides, and after I removed them issue resolved

  5. smcv commented on Dec 12, 2022

    @smcv
    Collaborator

    #5213 avoids this by refusing to share all of /run with the app, with a warning message.

  6. 12 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions