Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea58704f authored by Xiaoke Wang's avatar Xiaoke Wang Committed by Greg Kroah-Hartman
Browse files

integrity: check the return value of audit_log_start()



commit 83230351c523b04ff8a029a4bdf97d881ecb96fc upstream.

audit_log_start() returns audit_buffer pointer on success or NULL on
error, so it is better to check the return value of it.

Fixes: 3323eec9 ("integrity: IMA as an integrity service provider")
Signed-off-by: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
Cc: <stable@vger.kernel.org>
Reviewed-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52871671
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode,
		return;

	ab = audit_log_start(audit_context(), GFP_KERNEL, audit_msgno);
	if (!ab)
		return;
	audit_log_format(ab, "pid=%d uid=%u auid=%u ses=%u",
			 task_pid_nr(current),
			 from_kuid(&init_user_ns, current_cred()->uid),