lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 15 Oct 2009 10:01:13 +0800
From:	Li Zefan <lizf@...fujitsu.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [GIT PULL] tracing: Fix misuse of strncpy to copy boot params

> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 4506826..621d81e 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -131,7 +131,7 @@ static char *default_bootup_tracer;
>  
>  static int __init set_ftrace(char *str)
>  {
> -	strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
> +	strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);

Actually using strncpy() here is fine.

See how the str buf is used:

int register_tracer(struct tracer *type)
{
	...
	if (strncmp(default_bootup_tracer, type->name, MAX_TRACER_SIZE))
	...
}

>  	default_bootup_tracer = bootup_tracer_buf;
>  	/* We are using ftrace early, expand it */
>  	ring_buffer_expanded = 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ