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]
Message-ID: <20170323062057.GE17578@localhost.localdomain>
Date:   Wed, 22 Mar 2017 23:20:57 -0700
From:   Darren Hart <dvhart@...radead.org>
To:     Joe Perches <joe@...ches.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Andy Whitcroft <apw@...onical.com>,
        John 'Warthog9' Hawley <warthog9@...lescrag.net>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: Allow space leading blank lines in email
 headers

On Wed, Mar 22, 2017 at 10:35:21PM -0700, Joe Perches wrote:
> Allow a leading space and otherwise blank link in the email headers
> as it can be a line wrapped Spamassassin multiple line string or any
> other valid rfc 2822/5322 email header.
> 
> The line with space causes checkpatch to erroniously think that it's
> in the content body, as opposed to headers and thus flag a mail header
> as an unwrapped long comment line.
> 
> Reported-by: Darren Hart (VMware) <dvhart@...radead.org>
> Original-patch-by: John 'Warthog9' Hawley (VMware) <warthog9@...lescrag.net>
> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
>  scripts/checkpatch.pl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 832e8150dba3..089c974aa3a5 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2628,8 +2628,8 @@ sub process {
>  # Check if it's the start of a commit log
>  # (not a header line and we haven't seen the patch filename)
>  		if ($in_header_lines && $realfile =~ /^$/ &&
> -		    !($rawline =~ /^\s+\S/ ||
> -		      $rawline =~ /^(commit\b|from\b|[\w-]+:).*$/i)) {
> +		    !($rawline =~ /^\s+(?:\S|$)/ ||

First, thanks Joe. The above change alone is sufficient to resolve the specific
issue I observed with the long header fields (RFC 5322 2.2.3) used by spam
assassin.

Tested-by: Darren Hart (VMware) <dvhart@...radead.org>

I do have an open question regarding how we're going about testing for the end
of the header lines. Since we're not just testing for an empty line to separate
headers and body, there is clearly more going on here - but I'm not sure what it
is ... so I can't be sure this doesn't have an unintended consequence.

> +		      $rawline =~ /^(?:commit\b|from\b|[\w-]+:)/i)) {

This appears to be an unrelated change, introducing the non-capturing-group
(?:) and dropping the superfluous .*$ postfix. Did I get that right?

-- 
Darren Hart
VMware Open Source Technology Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ