[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1349395051-12145-1-git-send-email-sasha.levin@oracle.com>
Date: Thu, 4 Oct 2012 19:57:31 -0400
From: Sasha Levin <sasha.levin@...cle.com>
To: viro@...iv.linux.org.uk, keescook@...omium.org
Cc: levinsasha928@...il.com, davej@...hat.com,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Sasha Levin <sasha.levin@...cle.com>
Subject: [PATCH] fs: handle failed audit_log_start properly
audit_log_start() may return NULL, this is unchecked by the caller in
audit_log_link_denied() and could cause a NULL ptr deref.
Introduced by commit a51d9eaa ("fs: add link restriction audit reporting").
Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
---
kernel/audit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/audit.c b/kernel/audit.c
index 4d0ceed..40414e9 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1440,6 +1440,8 @@ void audit_log_link_denied(const char *operation, struct path *link)
ab = audit_log_start(current->audit_context, GFP_KERNEL,
AUDIT_ANOM_LINK);
+ if (!ab)
+ return;
audit_log_format(ab, "op=%s action=denied", operation);
audit_log_format(ab, " pid=%d comm=", current->pid);
audit_log_untrustedstring(ab, current->comm);
--
1.7.12
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists