I didn't want to block this from getting into focal-proposed because I
think it would be good to get some initial testing already, especially
that the package has been sponsored by someone from the security team.
But I'm not entirely happy with the test/regression-potential stories
for this bug, so maybe it would be nice to re-visit that. Both of those
seem to be copied from comments under the long thread in the bug here,
which is fine, but I'd like to make sure this is all that needs testing.

I don't know apparmor code, but I'd like if someone could re-visit the
cap* patches added to this upload and check if there's anything that we
could regress *besides* in the actual feature-set. There's a lot of
patches here touching a lot of code, so there's surely a risk that we
might influence existing code in some additional way? Or are those three
cases the only possible risk?

For such a change, is there also some other testing we could do to make
sure things work properly?

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apparmor in Ubuntu.
https://bugs.launchpad.net/bugs/1964636

Title:
  Incorrect handling of apparmor `bpf` capability

Status in apparmor package in Ubuntu:
  In Progress
Status in snapd package in Ubuntu:
  Incomplete
Status in apparmor source package in Focal:
  Fix Committed

Bug description:
  [ Impact ]

  The apparmor_parser before the 3.0 release would build its capability list 
from the installed kernel headers. The apparmor_parser was built against a 
kernel without support for cap 'bpf'
  This was fixed in 3.0 by having a static caps list (with full mapping info) 
and the dynamic auto-generated list (against the kernel headers) that is used 
to check that the static list has not become stale. In addition the parser can 
pull kernel supported caps straight from the apparmor kernel module (it will 
however be missing the mapping info).
  Backporting the patches from 3.0 fixes the issue.

  [ Test Plan ]

  Before the fix, the following profile fails loading:

  # echo "profile foo { capability bpf, }" | apparmor_parser -Q
  AppArmor parser error, in stdin line 1: Invalid capability bpf.
  # echo $?
  1

  After the fix, it works as expected:

  # echo "profile foo { capability bpf, }" | apparmor_parser -Q
  # echo $?
  0

  [ Where problems could occur ]

  With these changes, the parser can change its behavior based on a few things.
  1. the kernel its built against. This would not change behavior when run in a 
container vs at system level.

  2. If a feature-file is specified, via --features-file, --policy-
  features, or --kernel-features. This allows overriding the normal
  policy and kernel examination that the parser does when compiling
  policy.

  3. If /sys/kernel/security/apparmor/features is not available. The
  parser will fallback to an old set of features available in a kernel
  before the kernel module started exporting what the kernel module
  supports on the running kernel.

  [ Other Info ]

  The patches for focal (apparmor-2.13) can be found at:
  https://launchpad.net/~georgiag/+archive/ubuntu/mqueue-sru/
  As mentioned before, these patches are already running on apparmor-3.0.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1964636/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to