[RFC PATCH 3/5] audit: don't use simple_strtol() anymore

Richard Guy Briggs rgb at redhat.com
Sun Sep 3 04:50:19 UTC 2017


On 2017-09-01 09:44, Paul Moore wrote:
> From: Paul Moore <paul at paul-moore.com>
> 
> The simple_strtol() function is deprecated, use kstrtol() instead.
> 
> Signed-off-by: Paul Moore <paul at paul-moore.com>

Reviewed-by: Richard Guy Briggs <rgb at redhat.com>

> ---
>  kernel/audit.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/audit.c b/kernel/audit.c
> index de8a9b8465ae..9df2ef4d3e53 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -1566,8 +1566,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;
> 
> --
> Linux-audit mailing list
> Linux-audit at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit

- RGB

--
Richard Guy Briggs <rgb at redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635




More information about the Linux-audit mailing list