Commit Graph

6627 Commits

Author SHA1 Message Date
Phaedrus Leeds
a0d8a1dcf3 Update variant-schema-compiler to fix build
Fixes https://github.com/flatpak/flatpak/issues/4534

(cherry picked from commit 6cb4a2598e)
2022-01-04 11:45:01 +00:00
JakobDev
b3dbfd9975 Remove Souk from Readme
(cherry picked from commit d9b57b9c95)
2022-01-04 11:44:10 +00:00
Phaedrus Leeds
ffff812957 transaction: Fix signal Since annotations
(cherry picked from commit 20fd994c5c)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
ea322f3df0 dir: Fix typos in a warning
(cherry picked from commit fd4e9e84cd)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
ad26c8e1ff SECURITY.md: Update supported branches
(cherry picked from commit 4b89d92dbd)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
02b8701062 doc/flatpakrepo: Fix a typo
(cherry picked from commit 71a09d47d5)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
76d5928707 Pedantic typo fix
(cherry picked from commit 93d3cb4704)
2022-01-04 11:43:51 +00:00
Phaedrus Leeds
3f09faeb89 Fix capitalization of "false" in flatpakref keyfiles
g_key_file_get_boolean() only accepts lower case "true" and "false", so
correct some instances of "False" in key files. This makes no functional
difference as long as the error pointer isn't checked since
g_key_file_get_boolean() also returns false when it can't parse the
value as a boolean. But it still seems good to be correct, and someone
could interpret the existence of "IsRuntime=False" as implying that
"IsRuntime=True" will work, which it doesn't.

(cherry picked from commit b098191252)
2022-01-04 11:39:34 +00:00
Phaedrus Leeds
70b4a030c1 doc: Clarify default setting of noenumerate/nodeps options
(cherry picked from commit f94721bef2)
2022-01-04 11:39:20 +00:00
Phaedrus Leeds
438fd6b109 Merge pull request #4493 from piotrdrag/piotrdrag/pl-update-211017-1.12.x
Update Polish translation 211017 for flatpak-1.12.x
2021-10-19 11:43:05 -07:00
Piotr Drąg
12c4584593 Update Polish translation 2021-10-19 11:02:49 -07:00
Phaedrus Leeds
5f30403d2b CI: Add 1.12 branch 2021-10-19 11:00:31 -07:00
Simon McVittie
96aafda476 Regenerate .po files for release
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.12.2
2021-10-12 11:16:30 +01:00
Simon McVittie
f4db077a52 Set version number to 1.12.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-12 10:54:34 +01:00
Simon McVittie
666dc8dbcd NEWS: Add changes so far for 1.12.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-11 14:17:28 +01:00
Simon McVittie
486b978b44 NEWS: Clarify the user-facing feature enabled by improved subsandboxing
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-11 14:11:47 +01:00
Simon McVittie
ff0c48c780 NEWS: Mention CVE-2021-41133
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-11 14:11:23 +01:00
Simon McVittie
89fb54123a NEWS: Clarify what was fixed in 1.12.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-11 14:11:02 +01:00
Simon McVittie
72c38fe0bd common: Backport g_get_language_names_with_category() more thoroughly
Even though we are going to check all the `LC_*` environment variables,
if one of them is not set, we still need to consider LANGUAGE, LC_ALL
and LANG; there is no guarantee that *every* `LC_*` environment variable
is set (and in particular, during our build-time tests, they will usually
not be).

Resolves: https://github.com/flatpak/flatpak/issues/4471
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit ae59fb7aca)
2021-10-11 09:52:48 +02:00
Simon McVittie
bd2c58fc27 run: Improve error handling/diagnostics for calls into libseccomp
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 53bde36585)
2021-10-11 09:52:48 +02:00
Simon McVittie
97e128c2c1 Fix handling of syscalls only allowed by --devel
This was incorrectly looking at errno instead of -r.

Fixes: 0b38b0f0 "run: Handle unknown syscalls as intended"
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 3fc8c67267)
2021-10-11 09:52:48 +02:00
Piotr Drąg
946dd5d8a8 Update Polish translation 2021-10-11 09:44:42 +02:00
Phaedrus Leeds
03f525b92d NEWS: Fix typo of 1.12.0 2021-10-08 22:35:21 +01:00
Phaedrus Leeds
cbbe6a106a NEWS: Fix a typo 2021-10-08 22:35:21 +01:00
Alexander Larsson
afb3575d31 Update pofiles for release 1.12.1 2021-10-08 19:12:18 +02:00
Alexander Larsson
f968334ea3 Bump version to 1.2.1 2021-10-08 18:58:28 +02:00
Simon McVittie
270701f900 run: Handle unknown syscalls as intended
The error-handling here was

    if (r < 0 && r == -EFAULT)

but Alex says it was almost certainly intended to be

    if (r < 0 && r != -EFAULT)

so that syscalls not known to libseccomp are not a fatal error.

Instead of literally making that change, emit a debug message on -EFAULT
so we can see what is going on.

This temporarily weakens our defence against CVE-2021-41133
(GHSA-67h7-w3jq-vh4q) in order to avoid regressions: if the installed
version of libseccomp does not know about the recently-added syscalls,
but the kernel does, then we will not prevent non-native executables
from using those syscalls.

Resolves: https://github.com/flatpak/flatpak/issues/4458
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit d419fa6703)
2021-10-08 18:44:18 +02:00
Alexander Larsson
0cfd72442d Update pofiles for release 1.12.0 2021-10-08 13:20:58 +02:00
Alexander Larsson
48b808e4c2 Bump version to 1.12.0 2021-10-08 12:53:20 +02:00
Alexander Larsson
d8b8dff670 Update NEWS for release 2021-10-08 12:53:20 +02:00
Simon McVittie
462fca2c66 run: Don't allow chroot()
If we don't allow pivot_root() then there seems no reason why we should
allow chroot().

Partially fixes GHSA-67h7-w3jq-vh4q.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Simon McVittie
1330662f33 run: Don't allow unmounting filesystems
If we don't allow mounting filesystems, we shouldn't allow unmounting
either.

Partially fixes GHSA-67h7-w3jq-vh4q.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Simon McVittie
4c34815784 run: Block setns()
If we don't allow unshare() or clone() with CLONE_NEWUSER, we also
shouldn't allow joining an existing (but different) namespace.

Partially fixes GHSA-67h7-w3jq-vh4q.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Simon McVittie
9766ee05b1 run: Disallow recently-added mount-manipulation syscalls
If we don't allow mount() then we shouldn't allow these either.

Partially fixes GHSA-67h7-w3jq-vh4q.

Thanks: an anonymous reporter
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Simon McVittie
a10f52a756 run: Block clone3() in sandbox
clone3() can be used to implement clone() with CLONE_NEWUSER, allowing
a sandboxed process to get CAP_SYS_ADMIN in a new namespace and
manipulate its root directory. We need to block this so that AF_UNIX-based
socket servers (X11, Wayland, etc.) can rely on
/proc/PID/root/.flatpak-info existing for all Flatpak-sandboxed apps.

Partially fixes GHSA-67h7-w3jq-vh4q.

Thanks: an anonymous reporter
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Simon McVittie
26b12484eb common: Add a list of recently-added Linux syscalls
Historically, syscalls could take arbitrarily-different values on
different architectures, but new syscalls are added with syscall numbers
that align on each architecture.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Simon McVittie
89ae9fe74c run: Add cross-references for some other seccomp syscall filters
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Simon McVittie
e26ac7586c run: Add an errno value to seccomp filters
At the moment, if we block a syscall we always make it fail with EPERM,
but this is risky: user-space libraries can start to use new replacements
for old syscalls at any time, and will often treat EPERM as a fatal error.
For new syscalls, we should make the syscall fail with ENOSYS, which is
indistinguishable from running on an older kernel and will cause fallback
to an older implementation, for example clone3() to clone().

In future we should probably move from EPERM to ENOSYS for some of the
syscalls we already block, but for now keep the status quo.

This is a prerequisite for fixing the vulnerability tracked as
GHSA-67h7-w3jq-vh4q.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-08 12:53:20 +02:00
Alexander Larsson
9914dff925 tests: Fix test-sideload.sh if ostree is built with curl backend
The soup backend and the curl backend give slightly different error
messages, so we need to tweak the 404 assert check to match both.
2021-10-08 12:05:22 +02:00
Bartłomiej Piotrowski
3be48f3098 icon-validator: Mount ld.so.cache only if it exists
On musl-based systems, /etc/ld.so.cache does not exist, causing icon validation to fail.

This has been improperly reported at [1] instead of Flatpak repo.

[1] https://github.com/flathub/com.valvesoftware.Steam/issues/638
2021-10-04 09:07:35 +02:00
Philip Withnall
90e6c723d6 Merge pull request #4436 from pwithnall/4418-fix-parental-controls
flatpak-dir: Fix parental controls checks for root
2021-09-29 11:38:45 +01:00
Philip Withnall
8cb27763fc flatpak-dir: Fix parental controls checks for root
These checks were broken in commit d762a2f, as the commit failed to
consider the fact that `flatpak_dir_check_parental_controls()` is run
both in the `flatpak` CLI process run by the user, but also in the
`flatpak-system-helper` process which always runs as root, and which
handles any installations done on the system repository.

As a result, parental controls were not working for the system
repository.

Fix that by limiting the scope of the check to only pass if running
without the system helper. flatpak calls from root never go through the
system helper.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #4418
2021-09-28 13:38:48 +01:00
Alexander Larsson
b4e838a0fd Drop old-glib ci test as ubuntu 16.04 is no longer available
As per https://github.com/actions/virtual-environments/issues/3287
the support for ubuntu-16.04 stopped working on september 20:th, so
our CI job stopped starting.
2021-09-23 13:25:02 +02:00
gasinvein
9962b6bc1a run: Get gai.conf from session helper 2021-09-23 09:58:27 +02:00
gasinvein
38c03dff32 session-helper: Monitor gai.conf 2021-09-23 09:58:27 +02:00
Richard Maw
a96e9af37f Handle /var/tmp mounts when it is a symlink
In Yocto systems /var/tmp is a symlink to /var/volatile/tmp
because in its implementation of read-only rootfs /var is read-only
so /var/volatile is mounted as a tmpfs
and a subset of the paths point into it.

This would result in flatpak emitting mount arguments of
`--symlink ../var/volatile/tmp /var/tmp --bind /var/volatile/tmp /var/volatile/tmp`
which fails because flatpak has already added `--dir /var/tmp`
and the call to symlink fails with EEXIST.

This is fixed by blacklisting /var/tmp from symlink exports
in the same way /tmp is, so the bind is emitted as
`--bind /var/tmp /var/tmp`, which results in /var/volatile/tmp
being mounted into /var/tmp.
2021-09-23 09:57:33 +02:00
Ryan Gonzalez
86659a2bfb repair: Fix incorrect progress when refs are skipped
Issue was shown in this comment:

https://github.com/flatpak/flatpak/issues/3542#issuecomment-917497591
2021-09-17 09:25:29 +02:00
Ryan Gonzalez
f15f926284 Retrieve user languages for all locale categories
g_get_language_names() only returns the language names for the
LC_MESSAGES category, so mixed locale scenarios would result in missing
languages. Now, the languages are listed for each individual category.

Note that this issue was only present with the user installation. For
the system installation, the locales were queried from localed, and all
categories were checked.

In order to work on GLib versions < 2.58, the code to get language
names for a category has been backported.

Fixes #3712.
2021-09-17 09:23:52 +02:00
Kukuh Syafaat
a69f891f26 Update Indonesian translation 2021-09-17 08:59:17 +02:00
Simon McVittie
25e3952923 security policy: Specifically mention not reporting via Matrix
The Matrix room is just as public as the old IRC channel, which makes it
just as unsuitable for reporting security vulnerabilities as IRC.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-09-14 17:25:57 +01:00