lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 20 Aug 2022 01:26:06 -0700
From:   lily <floridsleeves@...il.com>
To:     selinux@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     paul@...l-moore.com, stephen.smalley.work@...il.com,
        eparis@...isplace.org, cgzones@...glemail.com,
        michalorzel.eng@...il.com, xiujianfeng@...wei.com,
        omosnace@...hat.com, lily <floridsleeves@...il.com>
Subject: [PATCH v1] selinux/ss/services.c: check the return value of audit_log_start() in security_sid_mls_copy()

The function audit_log_start() can fail, so its return value should be
checked against NULL. 

Signed-off-by: Li Zhong <floridsleeves@...il.com>
---
 security/selinux/ss/services.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index fe5fcf571c56..41d4c4ed93b7 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -3271,6 +3271,9 @@ int security_sid_mls_copy(struct selinux_state *state,
 				ab = audit_log_start(audit_context(),
 						     GFP_ATOMIC,
 						     AUDIT_SELINUX_ERR);
+				if (!ab)
+					goto out_unlock;
+
 				audit_log_format(ab,
 						 "op=security_sid_mls_copy invalid_context=");
 				/* don't record NUL with untrusted strings */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ