summaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2017-09-01 15:44:51 +0200
committerPaul Moore <paul@paul-moore.com>2017-11-10 22:07:50 +0100
commit80ab4df62706b882922c3bb0b05ce2c8ab10828a (patch)
tree4ff7e335ec3ca32285576be444a62b4644f42aaf /kernel/audit.c
parentaudit: initialize the audit subsystem as early as possible (diff)
downloadlinux-80ab4df62706b882922c3bb0b05ce2c8ab10828a.tar.xz
linux-80ab4df62706b882922c3bb0b05ce2c8ab10828a.zip
audit: don't use simple_strtol() anymore
The simple_strtol() function is deprecated, use kstrtol() instead. Reviewed-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index db71c45ea6f8..e75918f79a83 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1567,8 +1567,13 @@ postcore_initcall(audit_init);
/* Process kernel command-line parameter at boot time. audit=0 or audit=1. */
static int __init audit_enable(char *str)
{
- audit_default = !!simple_strtol(str, NULL, 0);
- if (!audit_default)
+ long val;
+
+ if (kstrtol(str, 0, &val))
+ panic("audit: invalid 'audit' parameter value (%s)\n", str);
+ audit_default = (val ? AUDIT_ON : AUDIT_OFF);
+
+ if (audit_default == AUDIT_OFF)
audit_initialized = AUDIT_DISABLED;
audit_enabled = audit_default;
audit_ever_enabled = !!audit_enabled;