[PATCH] audit: don't generate loginuid log when audit disabled

From: Richard Guy Briggs
Date: Mon Mar 03 2014 - 17:31:50 EST


From: Gao feng <gaofeng@xxxxxxxxxxxxxx>

If audit is disabled, we shouldn't generate loginuid audit
log.

Cc: stable@xxxxxxxxxxxxxxx # v3.13-rc1
Acked-by: Eric Paris <eparis@xxxxxxxxxx>
Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
Signed-off-by: Richard Guy Briggs <rgb@xxxxxxxxxx>
Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---

Already upstream in 3.14-rc1. This fixes a bug introduced by:
da0a6104 audit: loginuid functions coding style


kernel/auditsc.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index df1e685..9ab02fa 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1971,6 +1971,9 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid,
struct audit_buffer *ab;
uid_t uid, ologinuid, nloginuid;

+ if (!audit_enabled)
+ return;
+
uid = from_kuid(&init_user_ns, task_uid(current));
ologinuid = from_kuid(&init_user_ns, koldloginuid);
nloginuid = from_kuid(&init_user_ns, kloginuid),
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/