mantic kernel 6.5.0.1006 Adds io_uring apparmor feature

Bug #2037567 reported by John Chittum
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Fix Released
Undecided
John Chittum

Bug Description

starting with kernel package(s) 6.5.0.1006, currently in mantic-proposed, `io_uring` is added as a apparmor feature. This change results in preseeded snaps being unoptimized, as the mounted apparmor features in the chroot do not match the 6.5.0.1006 kernels. On a system running with the kernel

cat /sys/kernel/security/apparmor/features/io_uring/mask
sqpoll override_creds

1. ensure that this is correct with kernel and security teams
2. ~~ensure that this is the default going forward~~ : Create a 6.5 feature directory as it was pointed out by xnox that Mantic has more than 6.5 kernels at this time.

if 1 and 2, then set the default in `livecd-rootfs` for mounted apparmor features to include io_uring

SRU [Jammy]
====

[ Impact ]

 * Users of the 6.5 kernel will have un-optimized first boot experiences due to snaps not preseeding with the correct apparmor setup. This directly affects clouds, leading to boot speed degradation of anywhere from 10-30s (depending on snaps installed)

[ Test Plan ]

 * Create images with livecd-rootfs:ubuntu/jammy with the SRU'd change (the 6.5 directory in live-build/apparmor)
   * image must use an "edge" kernel or another forward pointing kernel as the HWE and cloud kernels have not rolled yet.
 * boot image(s)
 * check `snap debug seeding`. This should show successful seeding
   * if a long json output is observed, check the restart-key to see what features are missing. compare to 6.5 in ubuntu/master. check with security, apparmor, and kernel teams

[ Where problems could occur ]

 * If there is a difference in rules of 6.5 in mantic and 6.5 being released to Jammy
 *

[ Other Info ]

 * testing may be difficult, as we're trying to catch this before it lands. the codepath selecting kernel version is stable, so adding the configuration area should be safe, even if testing is not easily possible.

Related branches

John Chittum (jchittum)
Changed in livecd-rootfs (Ubuntu):
assignee: nobody → John Chittum (jchittum)
Revision history for this message
John Chittum (jchittum) wrote :
Download full text (5.0 KiB)

Did the following to ensure that current features, as listed in the files, are the same:

1. uploaded livecd-rootfs/live-build/apparmor/generic to test machine
2. ran following snippet
for dirn in ./*; do
 for filename in ${dirn}/*; do
  if [[ -f $filename ]]; then
   diffname=$(realpath $filename)
   echo "diffing $diffname to /sys/kernel/security/apparmor/features/${filename:2}"
   diff $diffname /sys/kernel/security/apparmor/features/${filename:2}
  fi
 done
done

diffing /home/ubuntu/caps/mask to /sys/kernel/security/apparmor/features/caps/mask
diffing /home/ubuntu/dbus/mask to /sys/kernel/security/apparmor/features/dbus/mask
diffing /home/ubuntu/domain/change_hat to /sys/kernel/security/apparmor/features/domain/change_hat
diffing /home/ubuntu/domain/change_hatv to /sys/kernel/security/apparmor/features/domain/change_hatv
diffing /home/ubuntu/domain/change_onexec to /sys/kernel/security/apparmor/features/domain/change_onexec
diffing /home/ubuntu/domain/change_profile to /sys/kernel/security/apparmor/features/domain/change_profile
diffing /home/ubuntu/domain/computed_longest_left to /sys/kernel/security/apparmor/features/domain/computed_longest_left
diffing /home/ubuntu/domain/fix_binfmt_elf_mmap to /sys/kernel/security/apparmor/features/domain/fix_binfmt_elf_mmap
diffing /home/ubuntu/domain/post_nnp_subset to /sys/kernel/security/apparmor/features/domain/post_nnp_subset
diffing /home/ubuntu/domain/stack to /sys/kernel/security/apparmor/features/domain/stack
diffing /home/ubuntu/domain/version to /sys/kernel/security/apparmor/features/domain/version
diffing /home/ubuntu/file/mask to /sys/kernel/security/apparmor/features/file/mask
diffing /home/ubuntu/ipc/posix_mqueue to /sys/kernel/security/apparmor/features/ipc/posix_mqueue
diffing /home/ubuntu/mount/mask to /sys/kernel/security/apparmor/features/mount/mask
diffing /home/ubuntu/namespaces/mask to /sys/kernel/security/apparmor/features/namespaces/mask
diffing /home/ubuntu/namespaces/pivot_root to /sys/kernel/security/apparmor/features/namespaces/pivot_root
diffing /home/ubuntu/namespaces/profile to /sys/kernel/security/apparmor/features/namespaces/profile
diffing /home/ubuntu/network/af_mask to /sys/kernel/security/apparmor/features/network/af_mask
diffing /home/ubuntu/network/af_unix to /sys/kernel/security/apparmor/features/network/af_unix
diffing /home/ubuntu/network_v8/af_mask to /sys/kernel/security/apparmor/features/network_v8/af_mask
diffing /home/ubuntu/policy/outofband to /sys/kernel/security/apparmor/features/policy/outofband
diffing /home/ubuntu/policy/set_load to /sys/kernel/security/apparmor/features/policy/set_load
diffing /home/ubuntu/ptrace/mask to /sys/kernel/security/apparmor/features/ptrace/mask
diffing /home/ubuntu/rlimit/mask to /sys/kernel/security/apparmor/features/rlimit/mask
diffing /home/ubuntu/signal/mask to /sys/kernel/security/apparmor/features/signal/mask

not perfect, but it does show nothing, file to file that i matched, has changed.

From the snap perspective:

snap debug seeding

seeded: true
preseeded: true
image-preseeding: 5.988s
seed-completion: 3.098s
preseed-system-key: {
  "apparmor-features": [
    "caps",
    "dbus",
...

Read more...

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 23.10.55

---------------
livecd-rootfs (23.10.55) mantic; urgency=medium

  * fix: add 6.5 kernel appamor features to livecd-rootfs based on
    features pulled from 6.5.0.1006 kernel in proposed (LP: #2037567)

 -- jchittum <email address hidden> Thu, 05 Oct 2023 11:10:43 -0500

Changed in livecd-rootfs (Ubuntu):
status: New → Fix Released
Revision history for this message
Gauthier Jolly (gjolly) wrote :

We need to backport this to 22.04 before HWE kernels roll to 6.5 otherwise we will have a similar issue with 22.04.

John Chittum (jchittum)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.