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: <867c6ww49g.wl-maz@kernel.org>
Date: Wed, 15 Jan 2025 14:17:15 +0000
From: Marc Zyngier <maz@...nel.org>
To: James Clark <james.clark@...aro.org>
Cc: linux-arm-kernel@...ts.infradead.org,
	robh@...nel.org,
	broonie@...nel.org,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Oliver Upton <oliver.upton@...ux.dev>,
	Anshuman Khandual <anshuman.khandual@....com>,
	James Morse <james.morse@....com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] arm64/sysreg: Enforce whole line match for closing blocks

On Wed, 15 Jan 2025 13:42:54 +0000,
James Clark <james.clark@...aro.org> wrote:
> 
> Match on the whole line to prevent matching on prefixes like "Endsysreg"
> vs "EndsysregFields". This could potentially make the script go wrong
> in weird ways so make it fall through to the fatal unhandled statement
> catcher if it doesn't fully match the current block.
> 
> Signed-off-by: James Clark <james.clark@...aro.org>
> ---
>  arch/arm64/tools/gen-sysreg.awk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
> index 1a2afc9fdd42..7c7412adf90e 100755
> --- a/arch/arm64/tools/gen-sysreg.awk
> +++ b/arch/arm64/tools/gen-sysreg.awk
> @@ -127,7 +127,7 @@ END {
>  	next
>  }
>  
> -/^EndSysregFields/ && block_current() == "SysregFields" {
> +/^EndSysregFields$/ && block_current() == "SysregFields" {

The problem with this sort of things is that it will now fail with
trailing spaces, which is both counter-intuitive and pretty hard to
spot.

Why don't you simply match the field number, like you do in patch 3?

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ