From: lily <floridsleeves@gmail.com>
To: selinux@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: paul@paul-moore.com, stephen.smalley.work@gmail.com,
eparis@parisplace.org, cgzones@googlemail.com,
michalorzel.eng@gmail.com, xiujianfeng@huawei.com,
omosnace@redhat.com, lily <floridsleeves@gmail.com>
Subject: [PATCH v1] selinux/ss/services.c: check the return value of audit_log_start() in security_sid_mls_copy()
Date: Sat, 20 Aug 2022 01:26:06 -0700 [thread overview]
Message-ID: <20220820082606.953886-1-floridsleeves@gmail.com> (raw)
The function audit_log_start() can fail, so its return value should be
checked against NULL.
Signed-off-by: Li Zhong <floridsleeves@gmail.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
next reply other threads:[~2022-08-20 8:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-20 8:26 lily [this message]
2022-08-20 14:19 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220820082606.953886-1-floridsleeves@gmail.com \
--to=floridsleeves@gmail.com \
--cc=cgzones@googlemail.com \
--cc=eparis@parisplace.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michalorzel.eng@gmail.com \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=xiujianfeng@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®