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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20130306162133.c2b3027c5cf75582d4f84869@linux-foundation.org>
Date:	Wed, 6 Mar 2013 16:21:33 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Fredrik Gustafsson <iveqy@...qy.com>
Cc:	apw@...onical.com, linux-kernel@...r.kernel.org,
	Joe Perches <joe@...ches.com>
Subject: Re: [PATCH] Prevent use of unitialized variable

On Mon,  4 Mar 2013 00:42:49 +0100 Fredrik Gustafsson <iveqy@...qy.com> wrote:

> Run checkpatch.pl -f kernel/fork.c in commit
> ecf02a607bd801e742d7bb35c6e40f7ca15edf03
> and checkpatch.pl will try to use an uninitialized variable.
> This patch fixes that.
> 

This isn't a good description of the problem you're seeing. 
ecf02a607bd801e7 is a merge commit and I see no perl problems running
"perl scripts/checkpatch.pl -f kernel/fork.c" with my setup, so it's
pretty mysterious.

It is best to quote the full error output when fixing errors.

That things work OK for me isn't surprising, as these things are quite
dependent upon the perl version.

> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3363,14 +3363,17 @@ sub process {
>  
>  			my $ms_addr = $2;
>  			my $ms_val = $7;
> -			my $ms_size = $12;
> -
> -			if ($ms_size =~ /^(0x|)0$/i) {
> -				ERROR("MEMSET",
> -				      "memset to 0's uses 0 as the 2nd argument, not the 3rd\n" . "$here\n$stat\n");
> -			} elsif ($ms_size =~ /^(0x|)1$/i) {
> -				WARN("MEMSET",
> -				     "single byte memset is suspicious. Swapped 2nd/3rd argument?\n" . "$here\n$stat\n");
> +
> +			if (defined $12) {
> +				my $ms_size = $12;
> +
> +				if ($ms_size =~ /^(0x|)0$/i) {
> +					ERROR("MEMSET",
> +						  "memset to 0's uses 0 as the 2nd argument, not the 3rd\n" . "$here\n$stat\n");
> +				} elsif ($ms_size =~ /^(0x|)1$/i) {
> +					WARN("MEMSET",
> +						 "single byte memset is suspicious. Swapped 2nd/3rd argument?\n" . "$here\n$stat\n");
> +				}
>  			}
>  		}

--
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