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: <ZktJtlIThiLpK0Na@J2N7QTR9R3.cambridge.arm.com>
Date: Mon, 20 May 2024 14:01:50 +0100
From: Mark Rutland <mark.rutland@....com>
To: Li Zetao <lizetao1@...wei.com>
Cc: Jiangfeng Xiao <xiaojiangfeng@...wei.com>, catalin.marinas@....com,
	will@...nel.org, Dave.Martin@....com, xieyuanbin1@...wei.com,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	nixiaoming@...wei.com, wangbing6@...wei.com, douzhaolei@...wei.com,
	liaohua4@...wei.com, lijiahuan5@...wei.com,
	wangfangpeng1@...wei.com, "zhangjianhua (E)" <chris.zjh@...wei.com>
Subject: Re: [PATCH] arm64: asm-bug: Add .align 2 to the end of __BUG_ENTRY

On Mon, May 20, 2024 at 08:05:25PM +0800, Li Zetao wrote:
> On 2024/5/20 18:33, Mark Rutland wrote:
> > On Fri, May 17, 2024 at 10:13:28PM +0800, Jiangfeng Xiao wrote:

> > > diff --git a/arch/arm64/include/asm/asm-bug.h b/arch/arm64/include/asm/asm-bug.h
> > > index c762038..6e73809 100644
> > > --- a/arch/arm64/include/asm/asm-bug.h
> > > +++ b/arch/arm64/include/asm/asm-bug.h
> > > @@ -28,6 +28,7 @@
> > >   	14470:	.long 14471f - .;			\
> > >   _BUGVERBOSE_LOCATION(__FILE__, __LINE__)		\
> > >   		.short flags; 				\
> > > +		.align 2;				\
> The use of .align 2 here is based on the assumption that struct bug_entry is
> 4-byte aligned. Currently, there is no problem with this assumption, but for
> compatibility reasons, refer to the riscv architecture and refactor the
> implementation of __BUG_FLAGS:
> 
> #define __BUG_FLAGS(flags)					\
> do {								\
> 	__asm__ __volatile__ (					\
> 		"1:\n\t"					\
> 			"ebreak\n"				\
> 			".pushsection __bug_table,\"aw\"\n\t"	\
> 		"2:\n\t"					\
> 			__BUG_ENTRY "\n\t"			\
> 			".org 2b + %3\n\t"                      \
> 			".popsection"				\
> 		:						\
> 		: "i" (__FILE__), "i" (__LINE__),		\
> 		  "i" (flags),					\
> 		  "i" (sizeof(struct bug_entry)));              \
> } while (0)
> 
> Align the real size of struct bug_entry through .org. What do you think?

I can see why that appears nice, but we can't do that in asm-bug.h
without something in asm-offets.h, and I suspect that's going to lead to
pain with circular header dependencies.

Regardless, if things change we'll need to make other changes here, so I
don't think we gain much.

I think it's preferable to have the explicit .align for now.

Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ