Commit Graph

7970 Commits

Author SHA1 Message Date
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
f62a83cdae Update NEWS for release candidate (1.15.10 rc1)
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-12 19:33:38 +01:00
Alexander Larsson
6bd603f683 persist directories: Pass using new bwrap --bind-fd option
Instead of passing a /proc/self/fd bind mount we use --bind-fd, which
has two advantages:
 * bwrap closes the fd when used, so it doesn't leak into the started app
 * bwrap ensures that what was mounted was the passed in fd (same dev/ino),
   as there is a small (required) gap between symlink resolve and mount
   where the target path could be replaced.

Please note that this change requires an updated version of bubblewrap.

Resolves: CVE-2024-42472, GHSA-7hgv-f2j8-xw87
[smcv: Make whitespace consistent]
Co-authored-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-12 19:33:33 +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
Alexander Larsson
2cdd1e1e5a Add test coverage for --persist
This adds three "positive" tests: the common case --persist=.persist, the
deprecated spelling --persist=/.persist, and the less common special case
--persist=. as used by Steam.

It also adds "negative" tests for CVE-2024-42472: if the --persist
directory is a symbolic link or contains path segment "..", we want that
to be rejected.

Reproduces: CVE-2024-42472, GHSA-7hgv-f2j8-xw87
[smcv: Add "positive" tests]
[smcv: Exercise --persist=..]
[smcv: Assert that --persist with a symlink produces expected message]
Co-authored-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-12 19:33:25 +01:00
Alexander Larsson
3caeb16c31 Don't follow symlinks when mounting persisted directories
These directories are in a location under application control, so we
can't trust them to not be a symlink outside of the files accessibe to
the application.

Continue to treat --persist=/foo as --persist=foo for backwards compat,
since this is how it (accidentally) worked before, but print a warning.

Don't allow ".." elements in persist paths: these would not be useful
anyway, and are unlikely to be in use, however they could potentially
be used to confuse the persist path handling.

This partially addresses CVE-2024-42472. If only one instance of the
malicious or compromised app is run at a time, the vulnerability
is avoided. If two instances can run concurrently, there is a
time-of-check/time-of-use issue remaining, which can only be resolved
with changes to bubblewrap; this will be resolved in a separate commit,
because the bubblewrap dependency might be more difficult to provide in
LTS distributions.

Helps: CVE-2024-42472, GHSA-7hgv-f2j8-xw87
[smcv: Make whitespace consistent]
[smcv: Use g_warning() if unable to create --persist paths]
[smcv: Use stat() to detect symlinks and warn about them]
Co-authored-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-12 19:26:44 +01:00
Simon McVittie
a32f231910 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-12 18:48:24 +01:00
Simon McVittie
251f1d58c8 doc: 1.12.x, 1.10.x are no longer security-supported
We should do a new 1.16.x soon, but after releasing that, we certainly
won't have the resources to backport security fixes beyond 1.14.x.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-09 17:29:31 +01:00
Sebastian Wick
5fc86a865c tests: Add an address sanitizer suppression file
There are two places where we deliberately leak some memory. There are
some cases which look like leaks in libostree but it's not impossible
that we made a mistake in flatpak.

Two other cases seem like issues in flatpak that I couldn't figure out.
2024-08-03 11:12:31 -05:00
Sebastian Wick
dad0160eee tests/build: Add address sanitizer log file path
Logging into files means we don't mess up the test TAP output and
anything that requires a specific format.
2024-08-03 11:12:31 -05:00
Sebastian Wick
6519993de8 tests/build: Stop sharing the same environment for all tests
This allows us to pass different environments to different tests.
2024-08-03 11:12:31 -05:00
Sebastian Wick
4b439ca001 oci-authenticator: Unref the GOptionContext when we're done with it 2024-08-03 11:12:31 -05:00
Sebastian Wick
7b096b4929 portal: Free the ops from flatpak_transaction_get_operations
The returned list is transfer full so we use g_autolist for a deep
cleanup.
2024-08-03 11:12:31 -05:00
Sebastian Wick
3e2b76a351 revokefs: Clean up struct fuse_args with fuse_opt_free_args 2024-08-03 11:12:31 -05:00
Sebastian Wick
fd5e406473 repo-utils: Don't take ownership of the extra data source name
Only get a pointer to the name which is valid as long as the input
GVariant is valid.

Closes: https://github.com/flatpak/flatpak/issues/5883
2024-08-03 11:12:31 -05:00
Sebastian Wick
efa48c1c21 dir: Use same mechanism for get_system/user_default_base_dir_location
Also add the same missing valgrind suppression for the system dir
location.
2024-08-03 11:12:31 -05:00
Simon McVittie
e5c97002e2 doc/release-checklist.md: Fix a leftover Autotools reference
In 1.15.x we're using `meson dist`, not `make distcheck`.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-22 19:12:31 +01:00
Simon McVittie
b026910d1c Update translation files for release
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.15.9
2024-07-22 17:58:03 +01:00
Simon McVittie
1589584875 Prepare v1.15.9
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-22 17:47:36 +01:00
Simon McVittie
bde1e8b4e6 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-22 17:45:57 +01:00
Ekaterine Papava
75b21fb23e Update ka.po 2024-07-22 17:40:55 +01:00
Rafael Fontenelle
c374ff37de Update Brazilian Portuguese translation 2024-07-22 17:39:54 +01:00
Simon McVittie
aca754af78 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-16 18:03:55 +01:00
Kalev Lember
4bf4f32c16 dir: Make sure all parse_ref_file out params are consistently cleared
parse_ref_file() cleared all its out params to NULL, with the exception
of collection_id_out. Make sure to clear this one as well to avoid
surprises in the future.

Fixes commit ae7d96037 that added collection ID support to flatpakref.
2024-07-16 17:55:31 +01:00
Daniel Winzen
07f55b32a5 run: Test whether sysfs mountpoints are accessible before mounting them
In some restrictive environments like Whonix, access to /sys/ is blocked by file
permissions (chmod 0700 /sys). Previously, Flatpak would give bwrap a
command-line that will fail altogether in these locked-down environments.
Instead, fall back to running the app with no access to these /sys
subdirectories.

The application will be unable to enumerate game controllers and similar
hardware devices in this situation, but that's the same limited functionality
that would be seen for a non-sandboxed application.

Resolves: https://github.com/flatpak/flatpak/issues/5138
2024-07-16 17:54:27 +01:00
Simon McVittie
51de8f9294 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-16 17:50:43 +01:00
Simon McVittie
9f1e6dc370 Merge pull request #5800 from smcv/libglnx-into-subtree
Convert libglnx, variant-compiler into `git subtree`
2024-07-16 17:33:17 +01:00
Simon McVittie
5150678ed0 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-16 17:29:42 +01:00
Simon McVittie
33212f5c11 utils: Remove flatpak-variant-private.h, no longer necessary
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
4add324060 prune: Include flatpak-variant-private.h before its -impl-private.h
This ensures that declarations are visible.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
25d38bab0a utils: Remove unnecessary flatpak-ref-utils-private.h inclusion
Include flatpak-ref-utils-private.h explicitly in each remaining
module that needs it (mostly for FlatpakDecomposed).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
87360c96e0 utils: Move remaining direct ostree dependencies to repo-utils
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
97cddd6e48 utils: Move more repository functionality to repo-utils
This further reduces circular dependencies: utils no longer has a
circular dependency with repo-utils or xml-utils.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
3271f9c25d utils: Export flatpak_get_compat_arch()
This will allow its caller to be moved into repo-utils.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
1b85a2c090 utils: Move more summary parsing into repo-utils
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
06970e015f utils: Move more repository functionality into repo-utils
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
31590889f8 ref-utils: Move flatpak_get_arch_for_ref() to here
The declaration was already in flatpak-ref-utils-private.h.

Fixes: 5dae1fc6 "Break out ref helper functions to separate file"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
c98a7c024f utils: Move OstreeRepo configuration accessors to a new translation unit
This is a step towards removing the libostree dependency from
flatpak-utils, which should be one of the lowest-level components.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
485f6bc5c5 common: Explicitly include ostree.h where needed
A subsequent commit will remove it from flatpak-utils-private.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
14db9d48cf common: Break out the parts of flatpak-utils that deal with FlatpakDir
This breaks the circular dependency between flatpak-utils and flatpak-dir.
There is still a circular dependency between flatpak-dir and
flatpak-dir-utils, but I don't want to make flatpak-dir even larger.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
3c82620bab repo-utils: New header for some implementation details of a repository
This will reduce circular dependencies involving FlatpakDir.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
89f8f3767a common: Move OCI registry manipulation into FlatpakOciRegistry
This is a step towards making flatpak-utils conceptually "smaller"
than all other translation units, with no dependencies beyond GLib and
libglnx. In particular, consolidating all the OCI registry manipulation
into one place means we can build other translation units without
libarchive.

This would also be a step towards being able to provide a build-time
option to build a libostree-only version of Flatpak without the OCI
feature or the direct libarchive dependency, if someone wanted to
implement that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Simon McVittie
722fec4581 utils: Include flatpak-metadata-private.h instead of -run-private.h
This avoids a circular dependency between -run and -utils.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 17:12:55 -03:00
Chris Williams
7c63731349 doc: Correct special value for flatpak config
To include all languages, the languages key must be set to `*all*`, not
`all`. That was apparently intended to provide symmetry with how the
value is represented in the output of `flatpak config`.
2024-07-09 20:48:07 +01:00
Simon McVittie
fd5c0b1f37 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-09 20:33:46 +01:00
Georges Basile Stavracas Neto
1b4ff8d526 flatpak-run-dbus: Allow two AT-SPI Registry signals in
These signals can be used by apps to monitor whether they need to emit
signals on the a11y bus or not. This can very significantly reduce
chattery on the a11y bus, and at least WebKit relies on these signals
to be broadcasted in.

The PR https://github.com/flatpak/xdg-dbus-proxy/pull/61 is required
for this changeset to work as expected, but it can land independently
as `--broadcast` is supported by xdg-dbus-proxy.
2024-07-09 09:23:32 -03:00
Hubert Figuière
92d7f9ec49 flatpak-permissions: Fix a memory leak
This occur by just running flatpak permission <SOME APP>

Signed-off-by: Hubert Figuière <hub@figuiere.net>
2024-06-27 20:55:50 -04:00
Scrambled777
cee83455e6 Hindi Translation Update
Fixes and update for Hindi translation.
2024-06-27 15:39:47 -03:00
lumingzh
1dbaa59a85 Update Chinese translation 2024-06-27 15:12:57 -03:00
Sebastian Wick
24a4c2464e dir: Free the returned GVariant of g_dbus_connection_call_sync
Closes: https://github.com/flatpak/flatpak/issues/5856
Fixes: 9532c8d3 ("dir: Reload DBus daemon config to ensure services get picked up")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-06-26 11:47:53 +01:00