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

run: Don't inherit LD_PRELOAD/LD_AUDIT from the host #5765

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
run: Don't inherit LD_PRELOAD/LD_AUDIT from the host
I don't think this env var makes much sense to pass into the sandbox
for similar reasons to LD_LIBRARY_PATH. Libraries from the host
just aren't relevant.

Users can still pass `--env=LD_PRELOAD=/foo` to use this functionality.
  • Loading branch information
TingPing authored and smcv committed Apr 24, 2024
commit 5ba396a20f09c5f65344407b67a81b694a05f030
9 changes: 6 additions & 3 deletions common/flatpak-run.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,13 @@ typedef struct

static const ExportData default_exports[] = {
{"PATH", "/app/bin:/usr/bin"},
/* We always want to unset LD_LIBRARY_PATH to avoid inheriting weird
* dependencies from the host. But if not using ld.so.cache this is
* later set. */
/* We always want to unset LD variables to avoid inheriting weird
* dependencies from the host. But if not using ld.so.cache LD_LIBRARY_PATH
is later set. */
{"LD_LIBRARY_PATH", NULL},
{"LD_PRELOAD", NULL},
{"LD_AUDIT", NULL},

{"XDG_CONFIG_DIRS", "/app/etc/xdg:/etc/xdg"},
{"XDG_DATA_DIRS", "/app/share:/usr/share"},
{"SHELL", "/bin/sh"},
Expand Down
2 changes: 2 additions & 0 deletions doc/flatpak-run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
<simplelist>
<member>PATH</member>
<member>LD_LIBRARY_PATH</member>
<member>LD_PRELOAD</member>
<member>LD_AUDIT</member>
<member>XDG_CONFIG_DIRS</member>
<member>XDG_DATA_DIRS</member>
<member>XDG_RUNTIME_DIR</member>
Expand Down