Merge tag 'apparmor-pr-2024-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor
Pull apparmor updates from John Johansen: "Cleanups - optimization: try to avoid refing the label in apparmor_file_open - remove useless static inline function is_deleted - use kvfree_sensitive to free data->data - fix typo in kernel doc Bug fixes: - unpack transition table if dfa is not present - test: add MODULE_DESCRIPTION() - take nosymfollow flag into account - fix possible NULL pointer dereference - fix null pointer deref when receiving skb during sock creation" * tag 'apparmor-pr-2024-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: apparmor: unpack transition table if dfa is not present apparmor: try to avoid refing the label in apparmor_file_open apparmor: test: add MODULE_DESCRIPTION() apparmor: take nosymfollow flag into account apparmor: fix possible NULL pointer dereference apparmor: fix typo in kernel doc apparmor: remove useless static inline function is_deleted apparmor: use kvfree_sensitive to free data->data apparmor: Fix null pointer deref when receiving skb during sock creation
This commit is contained in:
@@ -63,6 +63,26 @@ static inline struct aa_label *aa_get_newest_cred_label(const struct cred *cred)
|
||||
return aa_get_newest_label(aa_cred_raw_label(cred));
|
||||
}
|
||||
|
||||
static inline struct aa_label *aa_get_newest_cred_label_condref(const struct cred *cred,
|
||||
bool *needput)
|
||||
{
|
||||
struct aa_label *l = aa_cred_raw_label(cred);
|
||||
|
||||
if (unlikely(label_is_stale(l))) {
|
||||
*needput = true;
|
||||
return aa_get_newest_label(l);
|
||||
}
|
||||
|
||||
*needput = false;
|
||||
return l;
|
||||
}
|
||||
|
||||
static inline void aa_put_label_condref(struct aa_label *l, bool needput)
|
||||
{
|
||||
if (unlikely(needput))
|
||||
aa_put_label(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* aa_current_raw_label - find the current tasks confining label
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user