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] [day] [month] [year] [list]
Message-ID: <itoqfhz4pxaf7aclzajkxcdsxe5akxhgahzj4dp24leh7w334k@epnvcxdga75p>
Date: Fri, 5 Sep 2025 09:04:50 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: Tiezhu Yang <yangtiezhu@...ngson.cn>, 
	Peter Zijlstra <peterz@...radead.org>, Nathan Chancellor <nathan@...nel.org>, loongarch@...ts.linux.dev, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/3] objtool/LoongArch: Fix unreachable instruction
 warnings about EFISTUB

On Fri, Sep 05, 2025 at 12:36:16PM +0800, Huacai Chen wrote:
> Hi, Josh,
> 
> On Fri, Sep 5, 2025 at 5:46 AM Josh Poimboeuf <jpoimboe@...nel.org> wrote:
> >
> > On Thu, Sep 04, 2025 at 10:39:30AM -0700, Josh Poimboeuf wrote:
> > > On Thu, Sep 04, 2025 at 11:59:30AM +0800, Huacai Chen wrote:
> > > > This is from RISC-V code.
> > > >
> > > > __HEAD
> > > > SYM_CODE_START(_start)
> > > >         /*
> > > >          * Image header expected by Linux boot-loaders. The image header data
> > > >          * structure is described in asm/image.h.
> > > >          * Do not modify it without modifying the structure and all bootloaders
> > > >          * that expects this header format!!
> > > >          */
> > > > #ifdef CONFIG_EFI
> > > >         /*
> > > >          * This instruction decodes to "MZ" ASCII required by UEFI.
> > > >          */
> > > >         c.li s4,-13
> > > >         j _start_kernel
> > > > #else
> > > >         /* jump to start kernel */
> > > >         j _start_kernel
> > > >         /* reserved */
> > > >         .word 0
> > > > #endif
> > > >
> > > > The HEAD section has instructions, if you change it into a data
> > > > section then it loses the "x" attribute.
> >
> > Actually, the "x" attribute isn't needed for vmlinux.  The vmlinux
> > linker script places it in the text region regardless.
> >
> > Moving the data to a data section should be really simple, something
> > like the below.
> >
> > And yes, even the above RISC-V code can be in a data section.  Those
> > instructions are part of the 'struct riscv_image_header' data structure.
> This may work but also look strange (code in data section), it is more
> like a "workaround". :)

The "strange" part of the code is the intermixing of code and data.  If
they can't be separated, then they are part of a data structure and
belong in a data section.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ