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: <20220125113200.3829108-2-mark.rutland@arm.com>
Date:   Tue, 25 Jan 2022 11:31:54 +0000
From:   Mark Rutland <mark.rutland@....com>
To:     linux-kernel@...r.kernel.org
Cc:     acme@...hat.com, ardb@...nel.org, bp@...en8.de, broonie@...nel.org,
        catalin.marinas@....com, dave.hansen@...ux.intel.com,
        jpoimboe@...hat.com, jslaby@...e.cz,
        linux-arm-kernel@...ts.infradead.org, linux@...linux.org.uk,
        mark.rutland@....com, mingo@...hat.com, peterz@...radead.org,
        tglx@...utronix.de, will@...nel.org
Subject: [PATCH v2 1/7] arm: lib: remove leading whitespace in bitop macro

The `bitop` macro is used to create assembly functions for bit
operations, handling all the boilderplate such as ENTRY(), ENDPROC(),
etc.

Within the `bitop` macro, the argument to ENTRY() has leading whitespace
for alignment, but there is no leading whitespace for the argument to
ENDPROC().

The leading whitespace in the argument to ENTRY() prevents the value
from safely being token-pasted to form a longer symbol name, as
subsequent patches will need to do, where the value will be passed into
a new SYM_ENTRY_AT() macro:

  ENTRY(name)
  -> SYM_FUNC_START(name)
  -> SYM_START(name, [...])
  -> SYM_START_AT(name, [...])
  -> SYM_ENTRY_AT(name, [...])

... where SYM_ENTRY_AT() will token-paste name to form a local label
used by later macros:

| .set .L____sym_entry__##name, location ASM_NL

... but as this happens before assembler macros are evaluated, and
`name` will expand to `\name`, the token-pasting will retain the leading
space:

| .L____sym_entry__ \name

... and when evaluated within an assembler macro this will result in
build errors:

| [mark@...rids:~/src/linux]% git clean -qfdx
| [mark@...rids:~/src/linux]% usekorg 10.3.0 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -s multi_v7_defconfig
| [mark@...rids:~/src/linux]% usekorg 10.3.0 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -s arch/arm/lib
| arch/arm/lib/changebit.S: Assembler messages:
| arch/arm/lib/changebit.S:12: Error: expected comma after ".L____sym_entry__"
| make[1]: *** [scripts/Makefile.build:388: arch/arm/lib/changebit.o] Error 1
| make: *** [Makefile:1846: arch/arm/lib] Error 2

This patch removes the leading space such that the name can be
token-pasted.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@....com>
Cc: Russell King <linux@...linux.org.uk>
Cc: Will Deacon <will@...nel.org>
---
 arch/arm/lib/bitops.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 95bd359912889..36195edeb0b9f 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -4,7 +4,7 @@
 
 #if __LINUX_ARM_ARCH__ >= 6
 	.macro	bitop, name, instr
-ENTRY(	\name		)
+ENTRY(\name		)
 UNWIND(	.fnstart	)
 	ands	ip, r1, #3
 	strbne	r1, [ip]		@ assert word-aligned
@@ -29,7 +29,7 @@ ENDPROC(\name		)
 	.endm
 
 	.macro	testop, name, instr, store
-ENTRY(	\name		)
+ENTRY(\name		)
 UNWIND(	.fnstart	)
 	ands	ip, r1, #3
 	strbne	r1, [ip]		@ assert word-aligned
@@ -59,7 +59,7 @@ ENDPROC(\name		)
 	.endm
 #else
 	.macro	bitop, name, instr
-ENTRY(	\name		)
+ENTRY(\name		)
 UNWIND(	.fnstart	)
 	ands	ip, r1, #3
 	strbne	r1, [ip]		@ assert word-aligned
@@ -86,7 +86,7 @@ ENDPROC(\name		)
  * to avoid dirtying the data cache.
  */
 	.macro	testop, name, instr, store
-ENTRY(	\name		)
+ENTRY(\name		)
 UNWIND(	.fnstart	)
 	ands	ip, r1, #3
 	strbne	r1, [ip]		@ assert word-aligned
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ