linux-audit.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH] audit: do not panic kernel on invalid audit parameter
@ 2018-02-20 21:33 Greg Edwards
  2018-02-20 21:45 ` Paul Moore
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Greg Edwards @ 2018-02-20 21:33 UTC (permalink / raw)
  To: linux-audit; +Cc: Greg Edwards

If you pass in an invalid audit kernel boot parameter, e.g. 'audit=off',
the kernel panics very early in boot with no output on the console
indicating the problem.

This seems overly harsh.  Instead, print the error indicating an invalid
audit parameter value and leave auditing disabled.

Fixes: 80ab4df62706 ("audit: don't use simple_strtol() anymore")
Signed-off-by: Greg Edwards <gedwards@ddn.com>
---
 kernel/audit.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 227db99b0f19..d8af7682d6a3 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1572,8 +1572,10 @@ static int __init audit_enable(char *str)
 {
 	long val;
 
-	if (kstrtol(str, 0, &val))
-		panic("audit: invalid 'audit' parameter value (%s)\n", str);
+	if (kstrtol(str, 0, &val)) {
+		pr_err("invalid 'audit' parameter value (%s)\n", str);
+		val = AUDIT_OFF;
+	}
 	audit_default = (val ? AUDIT_ON : AUDIT_OFF);
 
 	if (audit_default == AUDIT_OFF)
-- 
2.14.3

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

end of thread, other threads:[~2018-03-07  4:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-20 21:33 [PATCH] audit: do not panic kernel on invalid audit parameter Greg Edwards
2018-02-20 21:45 ` Paul Moore
2018-02-20 22:00   ` Greg Edwards
2018-02-20 22:06     ` Paul Moore
2018-02-21  5:12   ` Richard Guy Briggs
2018-02-21 16:18 ` [PATCH v2] " Greg Edwards
2018-02-21 21:08   ` Paul Moore
2018-02-21 22:51     ` Greg Edwards
2018-02-22  1:13       ` Richard Guy Briggs
2018-02-21 22:52     ` Steve Grubb
2018-03-05 22:05 ` [PATCH] audit: do not panic on invalid boot parameter Greg Edwards
2018-03-06  3:24   ` Richard Guy Briggs
2018-03-06 14:38     ` Paul Moore
2018-03-06 18:53       ` Paul Moore
2018-03-07  4:13         ` 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;
as well as URLs for NNTP newsgroup(s).