[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220214092445.995230860@linuxfoundation.org>
Date: Mon, 14 Feb 2022 10:25:27 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Xiaoke Wang <xkernel.wang@...mail.com>,
Paul Moore <paul@...l-moore.com>,
Mimi Zohar <zohar@...ux.ibm.com>
Subject: [PATCH 4.9 01/34] integrity: check the return value of audit_log_start()
From: Xiaoke Wang <xkernel.wang@...mail.com>
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: 3323eec921ef ("integrity: IMA as an integrity service provider")
Signed-off-by: Xiaoke Wang <xkernel.wang@...mail.com>
Cc: <stable@...r.kernel.org>
Reviewed-by: Paul Moore <paul@...l-moore.com>
Signed-off-by: Mimi Zohar <zohar@...ux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
security/integrity/integrity_audit.c | 2 ++
1 file changed, 2 insertions(+)
--- a/security/integrity/integrity_audit.c
+++ b/security/integrity/integrity_audit.c
@@ -39,6 +39,8 @@ void integrity_audit_msg(int audit_msgno
return;
ab = audit_log_start(current->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),
Powered by blists - more mailing lists