45 Commits
Author SHA1 Message Date
Sebastian Wick 540a487ed1 subprojects: Update bubblewrap to v0.12.0
It contains a crucial security fix for mount destination path
resolution.
2026-08-26 14:29:17 +00:00
Sebastian Wick 49040df5f2 build: Use a meson .wrap file for the variant-schema-compiler subproject
It is not a meson project, but we can use the patch_directory key to
overlay a meson.build file over the git checkout. It uses
meson.override_find_program so that in flatpak, a call to
find_program('variant-schema-compiler') will find the program.
2026-08-21 12:55:37 +00:00
Sebastian Wick db7f12b4c8 build: Use a meson .wrap file for the libglnx subproject
And make libglnx a static library dependency.
2026-08-21 12:55:37 +00:00
Sebastian Wick 06f43a572e tests: Add test for copying symlinks 2026-08-19 14:57:39 +00:00
Sebastian Wick f637529fc9 glnx_file_copy_at: Use O_PATH fd for xattr and ownership operations
After creating the symlink, open it with O_PATH to pin the inode and
verify the target matches. All subsequent operations (xattrs, chown) go
through the pinned fd instead of path-based operations.
2026-08-19 14:57:39 +00:00
Sebastian Wick 8699d67a48 xattrs: Drop fd-based code paths from get_xattrs_impl
All callers now go through /proc/self/fd paths, so the flistxattr,
fgetxattr branches and the fd parameter are dead code.
2026-08-19 14:57:39 +00:00
Sebastian Wick b30c4ad983 xattrs: Use /proc/self/fd path in glnx_fd_set_all_xattrs
This allows it to work on O_PATH file descriptors, which is needed for
operating on symlinks.
2026-08-19 14:57:39 +00:00
Sebastian Wick 7339e32080 xattrs: Use /proc/self/fd path in glnx_fd_get_all_xattrs
This allows it to work on O_PATH file descriptors, which is needed for
operating on symlinks.
2026-08-19 14:57:39 +00:00
Sebastian Wick 6020dbf7f6 chase: Handle EAGAIN from openat2
From openat2(2):

  EAGAIN how.resolve contains either RESOLVE_IN_ROOT or
    RESOLVE_BENEATH, and the kernel could not ensure that a
    ".." component didn't escape (due to a race condition or
    potential attack).  The caller may choose to retry the
    openat2() call.

We should handle this by simply retrying the syscall.
2026-08-19 14:57:39 +00:00
Sebastian Wick 476b8591e9 subprojects: Update dbus-proxy.wrap to v0.1.8
Version 0.1.7 contains a security vulnerability, so let's bump it to a
version which does not.
2026-08-18 11:49:26 +00:00
Sebastian Wick f7138cbbc3 Update subtree: libglnx 2026-06-18
* backports, local-alloc: Provide a backport of g_autofd
* build: Add meson.override_dependency('libglnx', libglnx_dep)
* fdio: Add support for name_to_handle_at
* chase: Add glnx_chase_and_mkdirat

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-06-18 14:09:38 +02:00
Sebastian Wick 71034dd024 subprojects: Update dbus-proxy.wrap to v0.1.7
Versions up to 0.1.6 contain a security vulnerability, so let's bump it
to a version which does not.
2026-04-13 17:02:22 +01:00
Simon McVittie 0337cfde00 subprojects: Ignore .wraplock file generated by recent Meson
Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-04-12 07:23:58 +05:30
Simon McVittie 1293a6441b Update subtree: libglnx 2026-04-07
* fdio: Avoid relying on VLAs or gcc-specific constant-folding
* errors: Fix URL to an old libgsystem commit
* lockfile: Assert non-null path in make_lock_file for analyzers
* backports: Add g_clear_fd
* glnx-errors.h: add glnx_fd_throw[_*] variants
* fdio: Add glnx_fd_reopen
* local-alloc: Remove duplicate definition of glnx_unref_object
* fdio: Add glnx_statx
* chase: Add glnx_chaseat which functions similar to openat2
* chase: Add glnx_chase_and_statxat

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-04-07 20:41:49 +01:00
Simon McVittie 5f1938437a Update subtree: libglnx 2024-12-06
* Fix an assertion failure attempting to create a directory that exists
  as a dangling symlink[1]
* Fix a Meson deprecation warning[2]

[1] https://gitlab.gnome.org/GNOME/libglnx/-/issues/1
[2] https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/60

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-22 12:43:53 +00:00
Simon McVittie b730771bd7 subprojects: Update bubblewrap to v0.11.0
<https://github.com/containers/bubblewrap/releases/tag/v0.11.0>

We don't use any of the new features yet, so the minimum required
version in the build system is still 0.10.0.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-31 10:03:52 -05:00
Simon McVittie db5f037020 Update subtree: libglnx 2024-08-23
* Fix function detection when using -Werror=return-type
  (Resolves: flatpak/flatpak#5778)
* Add a fallback definition for G_PID_FORMAT
* Avoid warnings for g_steal_fd() when targeting older GLib
* Include <glib-unix.h> from glnx-backports.h

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 14:55:26 +01:00
Simon McVittie 368cf26f8d subprojects: Update dbus-proxy.wrap to v0.1.6
We still only require a system xdg-dbus-proxy to be v0.1.0 or later,
although a newer release is recommended.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 09:44:46 -03:00
Simon McVittie 417f3ca47c build: Require bubblewrap 0.10.0
This is functionally equivalent to the release candidate.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-14 09:59:19 +01:00
Simon McVittie bb8759ea10 build: Bump required bubblewrap version to 0.9.901 (0.10.0 rc1)
We need this for the --bind-fd option, which will close a race
condition in our solution to CVE-2024-42472.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-12 19:33:29 +01:00
Simon McVittie cf61ffa406 subprojects: Add a README explaining how to manage subprojects
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-06 18:34:57 +01:00
Simon McVittie c982e591ba Use Meson wrap files for bubblewrap and xdg-dbus-proxy
When combined with using `git subtree` for our mandatory vendored
dependencies, this avoids differences between what we ship in our git
repository (available to users via `git clone` or by unpacking the
result of `git archive`), and what's in our official source code
releases (which are the result of `meson dist`).

Differences between those artifacts would provide an attractive place
for attackers to hide malware, for example in CVE-2024-3094, so
avoiding differences is a good "nothing up my sleeve" mechanism to
make it less appealing for attackers to target Flatpak.

With default Meson settings, the wrap files will be used automatically
to download our suggested versions of these dependencies, unless
the `-Dsystem_bubblewrap=...`, `-Dsystem_dbus_proxy=...` Meson options
are used. In environments where automatic downloads are disabled via
`-Dwrap_mode=nodownload`, for example many Linux distributions,
specifying a system copy becomes mandatory.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-06 17:11:23 +01:00
Simon McVittie bd86ef906f Add 'subprojects/variant-schema-compiler/' from commit 'cfc356c38edfcf73c8ac240d215479b950f91b1f'
The workflow is the same as for libglnx.

git-subtree-dir: subprojects/variant-schema-compiler
git-subtree-mainline: 96a8e55b85
git-subtree-split: cfc356c38e
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-06 16:16:46 +01:00
Simon McVittie 96a8e55b85 Remove variant-schema-compiler submodule
Same reasoning as for libglnx.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-06 16:15:39 +01:00
Simon McVittie 2aed100945 Add 'subprojects/libglnx/' from commit '202b294e6079e23242e65e0426f8639841d1210b'
This makes the flatpak project more self-contained, and would have
avoided the problems we encountered with unintended changes in the
1.14.7 release. See <https://diziet.dreamwidth.org/14666.html> for an
opinionated description of some of the problems with submodules.

If we can eliminate submodules altogether, then it will become possible
to build Flatpak from a simple `git clone` or `git archive`, or from the
source tarballs auto-generated by Github (which are equivalent to a `git
archive`), without needing an extra step to populate the submodules. As
well as reducing the support burden from users periodically complaining
that our source releases are incomplete, this is a useful "nothing up
my sleeve" mechanism to make it easy to verify that our source releases
do not contain malicious changes hidden in vendored or generated files,
like the one that made CVE-2024-3094 possible.

Added with:

    git remote add --no-tags libglnx https://gitlab.gnome.org/GNOME/libglnx.git
    git fetch libglnx
    git subtree add -P subprojects/libglnx 202b294e60
    git commit --amend -s

To compare with upstream:

    git remote add --no-tags libglnx https://gitlab.gnome.org/GNOME/libglnx.git
    git fetch libglnx
    git diff HEAD:subprojects/libglnx libglnx/master

After checking the diff, updates can be merged into this project with:

    git subtree merge -P subprojects/libglnx libglnx/master
    git commit --amend -s

The commit merged here is the same one that was previously a submodule.
A subsequent commit will update it to the latest version of libglnx,
demonstrating how to review such updates.

git-subtree-dir: subprojects/libglnx
git-subtree-mainline: 7df25d63dfde9b4755479950f5b87bafe85cd277
git-subtree-split: 202b294e60
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-06 16:13:07 +01:00
Simon McVittie e94e7318e3 Remove libglnx submodule
This will allow it to be re-added as a `git subtree`, which stores
commit history inline in the flatpak git repository.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-06 16:12:43 +01:00
Simon McVittie 3477f6ccff Update submodule: xdg-dbus-proxy 0.1.5
* Fix handling of long object paths

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-03-27 14:14:32 +00:00
Simon McVittie a1bb18561f Update submodule: bubblewrap 0.9.0
* `--symlink` is now idempotent, meaning it succeeds if the
  symlink already exists and already has the desired target
  (containers/bubblewrap#549, flatpak/flatpak#2387,
  flatpak/flatpak#3477, flatpak/flatpak#5255)
* Report a better error message if `mount(2)` fails with `ENOSPC`
  (containers/bubblewrap#615, ValveSoftware/steam-runtime#637)
* Fix a double-close on error reading from `--args`, `--seccomp` or
  `--add-seccomp-fd` argument (containers/bubblewrap#558)
* Improve memory allocation behaviour
  (containers/bubblewrap#556, containers/bubblewrap#624)
* Silence various compiler warnings (containers/bubblewrap#559)

Resolves: flatpak/flatpak#2387
Resolves: flatpak/flatpak#3477
Resolves: flatpak/flatpak#5255
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-03-27 12:43:40 +00:00
Simon McVittie 8eee4bd452 Update submodule: libglnx 2024-02-09
* Provide fallback syscall wrapper for close_range()
* Backport g_closefrom() from GLib 2.79.2
* Backport g_fdwalk_set_cloexec() from Glib 2.79.2
* glnx_lsetxattrat(): Fix incorrect path argument
* Fix running `meson test` without first running `meson compile`
* Replace defunct mailing list with support forum

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-13 14:19:28 +00:00
Simon McVittie 17202b16e1 Update submodule: libglnx 2023-08-29
* Add g_steal_fd() backport
* Add g_strv_equal() backport
* Disable crash reporting when testing assertions

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-04 13:25:32 +01:00
Simon McVittie ec6ca9b6a6 Update submodule: bubblewrap 0.8.0
* Improve error message if seccomp is disabled in kernel config
* Add --disable-userns option (needed for #5084)
* Add --assert-userns-disabled option (needed for #5084)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-03-20 12:11:01 +00:00
Simon McVittie f3c79b2974 Update submodule: bubblewrap 0.7.0
- Better error messages on various failure modes

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-12 19:16:22 +00:00
Simon McVittie 7a144248f2 Update submodule: libglnx
- Backport g_memdup2

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-12 19:15:52 +00:00
Simon McVittie b0580b79b7 Update libglnx to commit e701578c
In particular, this version has more gtestutils backports, including a
version of g_test_message() that preserves correct TAP syntax for
multi-line messages.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-24 16:10:49 +01:00
Simon McVittie f8202512a9 Update xdg-dbus-proxy submodule to 0.1.4
This adds support for being used as a Meson subproject, and fixes some
minor bugs and compiler warnings.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-03 10:56:57 +02:00
Simon McVittie 091af2b481 Update bubblewrap subproject to v0.6.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-03 10:56:48 +02:00
Simon McVittie 5d12218591 Update libglnx submodule
This fixes some compiler warnings, and improves support for building as
a Meson subproject in preparation for adding a Meson build system to
Flatpak.

- https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/34
- https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/35

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-17 19:52:46 -07:00
Philip Withnall 9199a8efb6 subprojects: Update variant-schema-compiler to bring in leak fixes
This brings in:
 * https://gitlab.gnome.org/alexl/variant-schema-compiler/-/merge_requests/13
 * https://gitlab.gnome.org/alexl/variant-schema-compiler/-/merge_requests/14
 * https://gitlab.gnome.org/alexl/variant-schema-compiler/-/merge_requests/15

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-03 12:32:59 -08:00
Phaedrus Leeds 32b8f75ec4 Update libglnx to fix distcheck 2022-03-01 13:26:30 -08:00
Simon McVittie fc94fb7cd4 Update bubblewrap subproject to v0.6.1
* Add `--add-seccomp` (prerequisite for flatpak/flatpak#4462)
* Add a warning when repeated options are ignored
* Add a Meson build system
* Invoke bash via `PATH`
* Exit early when `argc == 0`

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-27 12:17:04 -08:00
Simon McVittie fcfd2786ff Update libglnx subproject
* Improve compatibility with eCryptFS (related to #4673)
* Improve compatibility with copying pseudo-files from /proc
* Add a flag to skip fchown() in glnx_file_copy_at()
* Add a rewinddir() wrapper to GLnxDirFdIterator
* Rename its generated config header to libglnx-config.h
* Fix a potential double-free while manipulating xattrs
* Use REUSE for copyright/licensing statements

Note that after merging this in an existing checkout, it will be
necessary to re-run autogen.sh.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-27 12:16:27 -08:00
Alexander Larsson 81d40fc8fa Update the bundled dbus-proxy to 0.1.3
This contains the fix to silence some recent GCC warnings, but also
some other minor cleanines fixes.
2022-02-11 15:01:20 +01:00
Phaedrus Leeds 6cb4a2598e Update variant-schema-compiler to fix build
Fixes https://github.com/flatpak/flatpak/issues/4534
2021-12-17 12:07:20 -08:00
Simon McVittie 47707560f5 Update bubblewrap to v0.5.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-23 08:58:36 +02:00
Simon McVittie 0b12aff826 build: Move submodules into subprojects directory
This is a step towards being able to build Flatpak using Meson, which
is becoming widely available even in LTS distributions. Meson's
built-in support for subprojects expects to find them in ./subprojects
at top level.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-04-06 10:21:29 +02:00