mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] audit: don't generate loginuid log when audit disabled
@ 2014-03-03 22:30 Richard Guy Briggs
       [not found] ` <20140303224904.GA26305@kroah.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Guy Briggs @ 2014-03-03 22:30 UTC (permalink / raw)
  To: stable, linux-kernel, linux-audit
  Cc: Gao feng, eparis, sgrubb, Richard Guy Briggs

From: Gao feng <gaofeng@cn.fujitsu.com>

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

Cc: stable@vger.kernel.org # v3.13-rc1
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
---

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-03 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-03 22:30 [PATCH] audit: don't generate loginuid log when audit disabled Richard Guy Briggs
     [not found] ` <20140303224904.GA26305@kroah.com>
2014-03-03 22:51   ` Richard Guy Briggs

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®