[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
** Changed in: apparmor Assignee: John Johansen (jjohansen) => Jaroslavas Karmazinas (cheops) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
This bug was fixed in the package apparmor - 2.13.2-9ubuntu6.1 --- apparmor (2.13.2-9ubuntu6.1) disco-proposed; urgency=medium * lp1820068.patch: don't skip read cache when options are set (LP: #1820068) * reenable ubuntu/parser-conf-no-expr-simplify.patch -- Jamie Strandboge Thu, 06 Jun 2019 21:04:34 + ** Changed in: apparmor (Ubuntu Disco) Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
FYI, I tested this and 2.13.2-9ubuntu6.1 fixes this bug. I also executed https://wiki.ubuntu.com/Process/Merges/TestPlans/AppArmor (sans dbus optional bits) and everything passed. Lastly, I wanted to double check the performance impact of no-expr- simplify on amd64 especially as it pertains to cloud and found it was slightly faster for default cloud, lxd and server policy. (It was slower on desktop, as expected and in the expected way due to the somewhat pathological evince profile. This has been the historical acceptable tradeoff to help ARM devices (note that because no-expr- simplify is faster with snap policy, with a handful of additional snaps, desktop breaks even then eventually gets faster too). ** Tags removed: verification-needed verification-needed-disco ** Tags added: verification-done verification-done-disco -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
Hello Jamie, or anyone else affected, Accepted apparmor into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apparmor/2.13.2-9ubuntu6.1 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping! N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days. ** Changed in: apparmor (Ubuntu Disco) Status: In Progress => Fix Committed ** Tags added: verification-needed verification-needed-disco -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
** Description changed: + [Impact] + + * AppArmor 2.13 unconditionally invalidates its cache when parser options are specified. To decrease compile times for ARM systems, -O no-expr-simplify has been used in Ubuntu for click and snap policy for many years, but was temporarily disabled during the disco development release with the 2.13 upload so caching properly worked everywhere. Now that a simple upstream workaround is available (and already in eoan), we'd like to apply the upstream patch and re-enable -O no-expr-simplify. + * A condition of the AppArmor 2.13 feature freeze exception was to fix this bug in SRU to re-enable -O no-expr-simplify. This will help compile times for all architectures with default and typical AppArmor policy (ie, a mixture of system and snap policy), but especially ARM systems with snaps where the improvement could be in terms of minutes saved. + * Specifically, the upstream patch workaround no longer considers parser options when deciding to invalidate the cache or not. It also re-enables an existing quilt patch to update /etc/apparmor/parser.conf to use no-expr-simplify. + + [Test Case] + + # setup + $ mkdir -p /tmp/aa/cache /tmp/aa/profiles + $ cp /etc/apparmor.d/sbin.dhclient /tmp/aa/profiles/ + + # no options, no cache, expect a miss and to write + $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load --add -- /tmp/aa/profiles + Cache: added primary location '/tmp/aa/cache' + Cache miss: /tmp/aa/profiles/sbin.dhclient + Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient + + # no options, cache, expect a hit + $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load --add -- /tmp/aa/profiles + Cache: added primary location '/tmp/aa/cache' + Cache hit: /tmp/aa/cache/26b63962.0/sbin.dhclient + + # reset + $ rm -rf /tmp/aa/cache/* + + # options, no cache, expect a miss and to write + $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load -O no-expr-simplify --add -- /tmp/aa/profiles + Cache: added primary location '/tmp/aa/cache' + Cache miss: /tmp/aa/profiles/sbin.dhclient + Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient + + # options, cache, expect a hit + $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load -O no-expr-simplify --add -- /tmp/aa/profiles + Cache: added primary location '/tmp/aa/cache' + Cache miss: /tmp/aa/profiles/sbin.dhclient # SHOULD BE A HIT + Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient + + Same thing happens if omitting -O no-expr-simplify but add Optimize=no- + expr-simplify to /etc/apparmor/parser.conf. + + [Regression Potential] + + The regression potential is considered low since the patch is simple and + easily verifiable. If something went wrong, it would be around cache + invalidation which the above test case will demonstrate it works + correctly. + + + # Original description + With 2.13.2 and the most recent testsuite patches from the 2.13 branch, I find that the cache works correctly when no options are specified. Eg # setup $ mkdir -p /tmp/aa/cache /tmp/aa/profiles $ cp /etc/apparmor.d/sbin.dhclient /tmp/aa/profiles/ # no options, no cache, expect a miss and to write $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache miss: /tmp/aa/profiles/sbin.dhclient Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient # no options, cache, expect a hit $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache hit: /tmp/aa/cache/26b63962.0/sbin.dhclient # reset $ rm -rf /tmp/aa/cache/* # options, no cache, expect a miss and to write $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load -O no-expr-simplify --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache miss: /tmp/aa/profiles/sbin.dhclient Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient # options, cache, expect a hit $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load -O no-expr-simplify --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache miss: /tmp/aa/profiles/sbin.dhclient # SHOULD BE A HIT Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient Same thing happens if omitting -O no-expr-simplify but add Optimize=no- expr-simplify to /etc/apparmor/parser.conf. ** Description changed: [Impact] - * AppArmor 2.13 unconditionally invalidates its cache when parser options are specified. To decrease compile times for ARM systems, -O no-expr-simplify has been used in Ubuntu for click and snap policy for many years, but was temporarily disabled during the disco development release with the 2.13 upload so caching
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
This bug was fixed in the package apparmor - 2.13.2-9ubuntu7 --- apparmor (2.13.2-9ubuntu7) eoan; urgency=medium * lp1820068.patch: don't skip read cache when options are set (LP: #1820068) * reenable ubuntu/parser-conf-no-expr-simplify.patch -- Jamie Strandboge Thu, 06 Jun 2019 21:46:34 + ** Changed in: apparmor (Ubuntu Eoan) Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
** Changed in: apparmor Status: In Progress => Fix Released ** Changed in: apparmor (Ubuntu Disco) Status: Triaged => In Progress ** Changed in: apparmor Assignee: (unassigned) => John Johansen (jjohansen) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
** Changed in: apparmor (Ubuntu Eoan) Status: In Progress => Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
Upstream patch is here: https://gitlab.com/apparmor/apparmor/merge_requests/385 ** Changed in: apparmor Status: New => In Progress ** Changed in: apparmor (Ubuntu) Status: New => Triaged ** Also affects: apparmor (Ubuntu Eoan) Importance: Undecided Status: Triaged ** Also affects: apparmor (Ubuntu Disco) Importance: Undecided Status: New ** Changed in: apparmor (Ubuntu Eoan) Assignee: (unassigned) => Jamie Strandboge (jdstrand) ** Changed in: apparmor (Ubuntu Disco) Assignee: (unassigned) => Jamie Strandboge (jdstrand) ** Changed in: apparmor (Ubuntu Eoan) Status: Triaged => In Progress ** Changed in: apparmor (Ubuntu Disco) Status: New => Triaged -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
** Description changed: With 2.13.2 and the most recent testsuite patches from the 2.13 branch, I find that the cache works correctly when no options are specified. Eg # setup $ mkdir -p /tmp/aa/cache /tmp/aa/profiles $ cp /etc/apparmor.d/sbin.dhclient /tmp/aa/profiles/ # no options, no cache, expect a miss and to write $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache miss: /tmp/aa/profiles/sbin.dhclient Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient # no options, cache, expect a hit $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache hit: /tmp/aa/cache/26b63962.0/sbin.dhclient # reset $ rm -rf /tmp/aa/cache/* - # no options, no cache, expect a miss and to write + # options, no cache, expect a miss and to write $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load -O no-expr-simplify --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache miss: /tmp/aa/profiles/sbin.dhclient Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient - # no options, cache, expect a hit + # options, cache, expect a hit $ /sbin/apparmor_parser -k --write-cache --cache-loc=/tmp/aa/cache --skip-kernel-load -O no-expr-simplify --add -- /tmp/aa/profiles Cache: added primary location '/tmp/aa/cache' Cache miss: /tmp/aa/profiles/sbin.dhclient # SHOULD BE A HIT Wrote cache: /tmp/aa/cache/26b63962.0/sbin.dhclient Same thing happens if omitting -O no-expr-simplify but add Optimize=no- expr-simplify to /etc/apparmor/parser.conf. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1820068] Re: specifying -O no-expr-simplify results in cache miss
Adding an Ubuntu 19.04 task in anticipation of the 2.13.2 upload. ** Also affects: apparmor (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820068 Title: specifying -O no-expr-simplify results in cache miss To manage notifications about this bug go to: https://bugs.launchpad.net/apparmor/+bug/1820068/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs