~ernestl/+git/ernestl_build_snapd:feature/steam-support-improvements

Last commit made on 2024-07-23
Get this branch:
git clone -b feature/steam-support-improvements https://git.launchpad.net/~ernestl/+git/ernestl_build_snapd
Only Ernest Lotter can upload to this branch. If you are Ernest Lotter please log in for upload directions.

Branch merges

Branch information

Name:
feature/steam-support-improvements
Repository:
lp:~ernestl/+git/ernestl_build_snapd

Recent commits

6a3d133... by Zygmunt Krynicki

Merge branches 'feature/steam-unconfined-seccomp-SNAPDENG-24864' and 'feature/steam-allow-all-v3' into feature/steam-support-improvements

39120c2... by Zygmunt Krynicki

interfaces: switch steam to unrestricted seccomp profile

To match similar changes to apparmor, steam-support will no longer
restrict launched games with a seccomp profile. Steam still relies on an
internal sandbox system, and the interaction of the two sandboxes has
had ill effects historically, with broken features, degraded performance
(real-time scheduling) or extensive logging.

Jira: https://warthogs.atlassian.net/browse/SNAPDENG-24864

Signed-off-by: Zygmunt Krynicki <email address hidden>

7ac15cc... by Zygmunt Krynicki

interfaces/builtin: apply userns, mqueue and io_uring conditionally

Signed-off-by: Zygmunt Krynicki <email address hidden>

3c0556e... by John Johansen

interfaces: transition steam_support to use allow all,

Steam needs very broad permissions, and needs to be able to run a
broad set of different games with different permissions requirements.
Steam updates often require an update to the permissions in the
steam_support interface.

To ease support and ensure a good user experience move steam_support
to a profile that allows all permissions. This will prevent the steam
snap from breaking when steam updates, or a new game is added
requiring permissions that are not covered.

For newer versions of apparmor (4.0.2 and later) use the "allow all,"
rule, which will dynamically expand to all supported permissions.

For older versions of apparmor use the set of apparmor rule classes
supported before apparmor 4.0.2.

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Zygmunt Krynicki <email address hidden>

78102e4... by Zygmunt Krynicki

sandbox/apparmor: add feature probe for io_uring mediation

Signed-off-by: Zygmunt Krynicki <email address hidden>

bc47413... by Zygmunt Krynicki

sandbox/apparmor: remove stray newline

Signed-off-by: Zygmunt Krynicki <email address hidden>

e57134f... by John Johansen

sandbox/apparmor: mask allow all rule until apparmor 4.0.2

Compilation of allow all is broken in apparmor_parser until version
4.0.2 and later. Ubuntu 24.04 shipped with 4.0.0~beta3, and had an SRU
based on 4.0.1. Detect the version and mask the presence of allow all
unless apparmor parser 4.0.2, or newer, is used.

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Zygmunt Krynicki <email address hidden>

ae4884d... by Zygmunt Krynicki

Revert "sandbox/apparmor: do not skip ABI 4.0 from host parser (#14167)" (#14223)

This reverts commit fa03549d4f81854852f20eafb80f2a6172947869.

We cannot use host AppArmor with 4.0 ABI as there's no control mechanism
to shield us from broken implementation of mqueue mediation class.

We look for the right version of apparmor parser and correctly not emit
the mqueue permission but since the host parser (4.0.0~beta3) looks at
host's ABI file which contains:

    ipc {posix_mqueue {create read write open delete setattr getattr}

And similarly the kernel supports posix_mqueue, then the parser (with
the bug or without the bug) will correctly not emit any permissions
related to mqueue mediation class, while emitting the mediation class
root element, causing the kernel to rightfully deny operations:

    [Mon Jul 22 12:43:40 2024] audit: type=1400 audit(1721652220.385:212):
    apparmor="DENIED" operation="unlink" class="posix_mqueue"
    profile="snap.docker.dockerd" name="/" pid=35290 comm="runc:[2:INIT]"
    requested="getattr" denied="getattr"class="posix_mqueue" fsuid=0 ouid=0

As such we need to do one of two things to allow host apparmor to be
used in a world with re-executing snapd:

 - Create our own ABI feature files that understand broken features and
   mask them, so that from the point of view of the kernel mqueue
   is _not_ mediated by the binary profile.
 - Detect presence of 4.0 ABI but ignore it on known-broken parser
   versions, effectively doing the same thing as the earlier approach
   but without creating a new ABI file that only snapd uses (possibly
   experiencing fewer bugs).

Signed-off-by: Zygmunt Krynicki <email address hidden>

a6a9a81... by Ernest Lotter

Revert "interfaces,sandbox: transition steam to permissive apparmor profile (…" (#14227)

This reverts commit e70a02f711129ea81c69ec354b4ebcbbb4a95d06.

e70a02f... by Zygmunt Krynicki

interfaces,sandbox: transition steam to permissive apparmor profile (#14221)

* sandbox/apparmor: mask allow all rule until apparmor 4.0.2

Compilation of allow all is broken in apparmor_parser until version
4.0.2 and later. Ubuntu 24.04 shipped with 4.0.0~beta3, and had an SRU
based on 4.0.1. Detect the version and mask the presence of allow all
unless apparmor parser 4.0.2, or newer, is used.

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Zygmunt Krynicki <email address hidden>

* sandbox/apparmor: remove stray newline

Signed-off-by: Zygmunt Krynicki <email address hidden>

* interfaces: transition steam_support to use allow all,

Steam needs very broad permissions, and needs to be able to run a
broad set of different games with different permissions requirements.
Steam updates often require an update to the permissions in the
steam_support interface.

To ease support and ensure a good user experience move steam_support
to a profile that allows all permissions. This will prevent the steam
snap from breaking when steam updates, or a new game is added
requiring permissions that are not covered.

For newer versions of apparmor (4.0.2 and later) use the "allow all,"
rule, which will dynamically expand to all supported permissions.

For older versions of apparmor use the set of apparmor rule classes
supported before apparmor 4.0.2.

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Zygmunt Krynicki <email address hidden>

* sandbox/apparmor: add feature probe for io_uring mediation

Signed-off-by: Zygmunt Krynicki <email address hidden>

* interfaces/builtin: apply userns, mqueue and io_uring conditionally

Signed-off-by: Zygmunt Krynicki <email address hidden>

---------

Signed-off-by: John Johansen <email address hidden>
Signed-off-by: Zygmunt Krynicki <email address hidden>
Co-authored-by: John Johansen <email address hidden>