Skip to content

Commit 8323035

Browse files
x2018mimizohar
authored andcommitted
integrity: check the return value of audit_log_start()
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: 3323eec ("integrity: IMA as an integrity service provider") Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Cc: <stable@vger.kernel.org> Reviewed-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
1 parent 926fd9f commit 8323035

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

security/integrity/integrity_audit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ void integrity_audit_message(int audit_msgno, struct inode *inode,
4545
return;
4646

4747
ab = audit_log_start(audit_context(), GFP_KERNEL, audit_msgno);
48+
if (!ab)
49+
return;
4850
audit_log_format(ab, "pid=%d uid=%u auid=%u ses=%u",
4951
task_pid_nr(current),
5052
from_kuid(&init_user_ns, current_uid()),

0 commit comments

Comments
 (0)