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:   Wed, 20 Dec 2017 01:41:55 -0800
From:   Joe Perches <joe@...ches.com>
To:     Gilad Ben-Yossef <gilad@...yossef.com>,
        Andy Whitcroft <apw@...onical.com>,
        linux-kernel@...r.kernel.org
Cc:     Ofir Drang <ofir.drang@....com>, linux-crypto@...r.kernel.org
Subject: Re: [PATCH] checkpatch: add *_ON_STACK to $declaration_macros

On Tue, 2017-06-27 at 10:55 +0300, Gilad Ben-Yossef wrote:
> Add the crypto API *_ON_STACK to $declaration_macros.
> 
> Resolves the following false warning:
> 
> WARNING: Missing a blank line after declarations
> +			int err;
> +			SHASH_DESC_ON_STACK(desc, ctx_p->shash_tfm);
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -733,6 +733,7 @@ our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)};
>  our $declaration_macros = qr{(?x:
>  	(?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(|
>  	(?:$Storage\s+)?LIST_HEAD\s*\(|
> +	(?:$Storage\s+)?[A-Z_]*_ON_STACK\(|

A few things:

The crypto _ON_STACK declarations cannot have a $Storage type.

There should be a \s* between the ON_STACK and the open parenthesis

There are other _ON_STACK types than the crypto uses

$ grep -rP --include=*.[ch] -oh "\b[A-Z_]+_ON_STACK\b" * | \
  sort | uniq -c | sort -rn
     68 SKCIPHER_REQUEST_ON_STACK
     45 SHASH_DESC_ON_STACK
     10 AHASH_REQUEST_ON_STACK
      4 PC_LOC_ON_STACK
      4 DECLARE_DPM_WATCHDOG_ON_STACK
      3 HISI_SAS_DECLARE_RST_WORK_ON_STACK
      3 CONFIG_ARCH_TASK_STRUCT_ON_STACK
      1 PT_SIZE_ON_STACK
      1 ALLOC_PT_GPREGS_ON_STACK

So perhaps:

	(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ