Skip to content
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

[1.10.x] run: Don't let XDG_RUNTIME_DIR from user override the value we set #4374

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

smcv
Copy link
Collaborator

@smcv smcv commented Aug 18, 2021

We use bwrap --setenv XDG_RUNTIME_DIR to set it to /run/user/UID,
regardless of what it is on the host system, but the changes made
to resolve CVE-2021-21261 unintentionally broke this by overwriting it
with the user's XDG_RUNTIME_DIR.

In practice this worked for most people, who either have
XDG_RUNTIME_DIR set to the same value we use (which is the conventional
setup from systemd-logind and elogind), or entirely unset (if they do not
have systemd-logind or elogind). However, it broke Wayland and other
XDG_RUNTIME_DIR-based protocols for people who intentionally set up an
XDG_RUNTIME_DIR that is different.

Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments"
Resolves: #4372


Should not be merged until after #4373 is.

We use `bwrap --setenv XDG_RUNTIME_DIR` to set it to `/run/user/UID`,
regardless of what it is on the host system, but the changes made
to resolve CVE-2021-21261 unintentionally broke this by overwriting it
with the user's XDG_RUNTIME_DIR.

In practice this worked for most people, who either have
XDG_RUNTIME_DIR set to the same value we use (which is the conventional
setup from systemd-logind and elogind), or entirely unset (if they do not
have systemd-logind or elogind). However, it broke Wayland and other
XDG_RUNTIME_DIR-based protocols for people who intentionally set up an
XDG_RUNTIME_DIR that is different.

Fixes: 6d1773d "run: Convert all environment variables into bwrap arguments"
Resolves: flatpak#4372
Signed-off-by: Simon McVittie <smcv@collabora.com>
tests/test-run.sh Show resolved Hide resolved
@alexlarsson
Copy link
Member

This looks ok to merge to me.

@smcv smcv marked this pull request as ready for review August 20, 2021 14:09
@smcv smcv merged commit d3e6e71 into flatpak:flatpak-1.10.x Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants