Commit Graph

8001 Commits

Author SHA1 Message Date
Simon McVittie
7ee98dc97a Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-28 13:42:02 +01:00
Georges Basile Stavracas Neto
31b8557365 Merge pull request #5918 from smcv/libglnx-20240420
Update subtree: libglnx 2024-08-23
2024-08-27 10:53:08 -03: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
87f2768fab Merge branch 'wip/smcv/glib-unix' into 'master'
glnx-backports: Include `<glib-unix.h>`

See merge request GNOME/libglnx!59
2024-08-23 13:53:06 +00:00
Simon McVittie
690295950c Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 14:04:26 +01:00
Simon McVittie
31291dc9a6 run: Use CVE identifiers to reference former vulnerabilities
These are more globally-recognised than GHSA IDs.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 13:58:30 +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
7dcb96b56e Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 13:15:35 +01:00
Simon McVittie
0101366da4 run: Debug-log the final context for an app
This indicates what sandboxing parameters we are going to be using
in the end.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 08:39:00 -03:00
Simon McVittie
260e4b374b run: Debug-log sources of parameters other than overrides
Every time we load something into the context, debug-log what it was.
Again, the more involved parts of this are skipped if debug logging is
disabled.

This will help to diagnose what is going on if the app metadata or the
command-line options are setting sandboxing parameters that break an app.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 08:39:00 -03:00
Simon McVittie
dbc6cd91af dir: When we load overrides, log them as debug messages
The more involved parts of this are skipped if debug logging is disabled.
This will help to diagnose what is going on when users have added
overrides that make their app not work as intended.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 08:39:00 -03:00
Simon McVittie
9784e5c0ed context: Add a function to log a FlatpakContext
This writes out the context as a series of debug messages.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 08:39:00 -03:00
Simon McVittie
5d62a6d80b utils: Add flatpak_is_debugging()
This can be used to disable code paths that assemble relatively
"expensive" debug information when debugging is not enabled.
It's activated by `flatpak -v -v`.

With a sufficiently modern GLib version, it also activates for
`G_MESSAGES_DEBUG=all` or `G_MESSAGES_DEBUG=flatpak`.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-23 08:39:00 -03:00
Simon McVittie
17cd5a24e6 tests: Constify test data where it's easy to do so
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
73cebfd83c run: Use hash tables as sets in the conventional way
GLib has optimizations for hash tables that are sets (conventionally
represented as key == value), and the APIs to work with such hash tables
are also slightly nicer, so use them instead of putting an arbitrary
constant string in the value.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
057c42fe2d run-dbus: Slightly increase const-correctness
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
5964b13f1e Constify arrays of program arguments
These are passed to non-const-correct APIs which still need a cast, but
at least we can declare the array in a way that reduces mistakes.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
1aeb381e91 Constify tables of immutable strings
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
fc1b32e97b table-printer: Slightly increase const-correctness
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
f7003e00c0 complete: Slightly increase const-correctness
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
f711ffc0e3 utils: Be more const-correct
For historical reasons C string literals are officially of type `char *`,
but if we build with -Wwrite-strings, they are `const char *` as they
should be.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 15:17:13 -03:00
Simon McVittie
0d61023710 test-run: Make it more obvious that we are setting G_DEBUG empty
shellcheck warning SC1007.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-22 16:08:33 +01:00
Simon McVittie
8b4f523c4f Update translation files for 1.15.10
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.15.10
2024-08-14 10:48:54 +01:00
Simon McVittie
501dc75bc8 NEWS, meson.build: Update for version 1.15.10
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-08-14 09:59:44 +01: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
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