Skip to content

Commit

Permalink
apparmor: Use pointer to struct aa_label for lbs_cred
Browse files Browse the repository at this point in the history
[ Upstream commit 37923d4 ]

According to the implementations of cred_label() and set_cred_label(),
we should use pointer to struct aa_label for lbs_cred instead of struct
aa_task_ctx, this patch fixes it.

Fixes: bbd3662 ("Infrastructure management of the cred security blob")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Xiu Jianfeng authored and gregkh committed Dec 31, 2022
1 parent 8d50ccf commit 10ae636
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/apparmor/lsm.c
Expand Up @@ -1170,10 +1170,10 @@ static int apparmor_inet_conn_request(const struct sock *sk, struct sk_buff *skb
#endif

/*
* The cred blob is a pointer to, not an instance of, an aa_task_ctx.
* The cred blob is a pointer to, not an instance of, an aa_label.
*/
struct lsm_blob_sizes apparmor_blob_sizes __lsm_ro_after_init = {
.lbs_cred = sizeof(struct aa_task_ctx *),
.lbs_cred = sizeof(struct aa_label *),
.lbs_file = sizeof(struct aa_file_ctx),
.lbs_task = sizeof(struct aa_task_ctx),
};
Expand Down

0 comments on commit 10ae636

Please sign in to comment.