There are various callsites in the AppArmor code that use aa_get_newest_*
to obtain a reference, followed by putting a reference during cleanup.
Using the condref variants of these functions allows avoiding taking
refcounts unnecessarily, improving performance. Where they cannot be used
(and the reason for that isn't immediately obvious), add comments documenting
the reason.

Ryan Lee (10):
  apparmor: explain why aa_file_perm cannot use the condref helpers
  apparmor: simplify update_to_newest_parent cleanup logic
  apparmor: add aa_get_newest_profile_condref and aa_put_profile_condref
    helpers
  apparmor: use aa_get_newest_profile_condref helpers in
    update_to_newest_parent
  apparmor: use aa_get_newest_label_condref in aa_replace_current_label
    nnp refresh
  apparmor: switch to aa_get_newest_cred_label_condref variants in
    apparmor_capget
  apparmor: switch to aa_get_newest_cred_label_condref variants in
    apparmor_getselfattr
  apparmor: also use condref variants in apparmor_task_kill USB branch
  apparmor: also use condref variants for apparmor_task_kill's tc cred
    label
  apparmor: explain why apparmor_getprocattr cannot use the condref
    helpers

 security/apparmor/file.c           |  7 +++++-
 security/apparmor/include/policy.h | 23 ++++++++++++++++++++
 security/apparmor/lsm.c            | 35 +++++++++++++++++++-----------
 security/apparmor/policy.c         | 13 +++++++----
 security/apparmor/task.c           |  5 +++--
 5 files changed, 63 insertions(+), 20 deletions(-)

-- 
2.43.0


Reply via email to