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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 10 Aug 2018 15:42:54 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Denis Efremov <efremov@...ux.com>
cc:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        "Luis R . Rodriguez" <mcgrof@...nel.org>,
        Nicolas Palix <nicolas.palix@...g.fr>,
        Gilles Muller <Gilles.Muller@...6.fr>,
        Michal Marek <michal.lkml@...kovi.net>,
        linux-kernel@...r.kernel.org, ldv-project@...uxtesting.org
Subject: Re: [PATCH] coccicheck: return proper error code on check fail



On Fri, 10 Aug 2018, efremov@...ux.com wrote:

> If coccicheck finds errors,

What do you mean by finds errors?  Do you mean that there is an error in
the behavior of coccicheck or that coccicheck finds an error in the source
code?

To put it another way, can you give an example of the kind of error you
are concerned about?

thanks,
julia

> it should return an error code
> distinct from zero. Current code instead of exiting with an
> error code of coccinelle returns error code of
> 'echo "coccicheck failed"' which is almost always equals to zero,
> thus failing original intention of alerting about errors.
> This patch fixes the problem.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <efremov@...ux.com>
> ---
>  scripts/coccicheck | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index 9fedca611b7f..e04d328210ac 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -128,9 +128,10 @@ run_cmd_parmap() {
>  	fi
>  	echo $@ >>$DEBUG_FILE
>  	$@ 2>>$DEBUG_FILE
> -	if [[ $? -ne 0 ]]; then
> +	err=$?
> +	if [[ $err -ne 0 ]]; then
>  		echo "coccicheck failed"
> -		exit $?
> +		exit $err
>  	fi
>  }
>
> --
> 2.17.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ