Lukasz is correct, we should be diligent in backporting the upstream patches. In regards to testing it's important to ensure apparmor and its new features work as intended with no errors in logs. As well as apparmor not quitting after a restart. All three effected LP's should be thoroughly tested.
There are over 20 patches being backported from upstream apparmor3.0 They fall into 3 categories. 1. capabilities improvements (maintain and generate the capabilities list used by apparmor) 2. abi [0] 3. mqueue [0] https://gitlab.com/apparmor/apparmor/-/wikis/AppArmorpolicyfeaturesabi#why- were-feature-abi-rules-added Most of the cap* patches are around generating and maintaining a list of supported capabilities. the first 2 caps (cap1 & cap2) introduce new scripts to generate a list of current capabilities and apparmor-bash related profiles. # cap1-Generate-CAPABILITIES-in-a-script-due-to-make-4.3.patch there is a new command under /common ./list_capabilities.sh # code that generates a list of capabilities CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE ... CAP_CHOWN # new python script to create vim profiles with python create-apparmor.vim.py # generates a new file called apparmor.vim.in # cap2-parser-Move-to-a-pre-generated-cap_names.h.patch use a pre-generated list of capabilities so that all capabilities are supported even when building against older kernels. The rest of the cap* patches are code cleanup related. @sli2100 I hope that answers some of the concern about capabilities patches. I will work on testing the other 3 affected LP's (1988270, 1728130, 1993353). So a total of 4 Lp's will be addressed. Please let me know if I/someone else can elaborate on the testing that needs to happen before approval. -- 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 : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp