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: <710349fd-08df-444f-b8c6-86b1249810df@app.fastmail.com>
Date: Tue, 17 Dec 2024 10:09:56 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Josh Poimboeuf" <jpoimboe@...nel.org>,
 "Peter Zijlstra" <peterz@...radead.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: "relocation to !ENDBR" objtool warnings

On Tue, Dec 17, 2024, at 09:54, Arnd Bergmann wrote:
>
> 00000000000000f0 <stpcpy>:
>   f0:   66 66 2e 0f 1f 84 00    data16 cs nopw 0x0(%rax,%rax,1)
>   f7:   00 00 00 00 
>   fb:   0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
>  100:   f3 0f 1e fa             endbr64


I had one more look at the assembler file created by gcc and found
that this is a 16-byte nop:

        .align 16
        .globl  stpcpy
        .type   stpcpy, @function
stpcpy:
        .p2align 5
        endbr64
.L30:
        movzbl  (%rsi), %eax    # MEM[(const char *)src_8 + -1B], _1
        movq    %rdi, %rdx      # dest, <retval>
        addq    $1, %rsi        #, src
        addq    $1, %rdi        #, dest
        movb    %al, -1(%rdi)   # _1, MEM[(char *)dest_9 + -1B]
        testb   %al, %al        # _1
        jne     .L30    #,
        movq    %rdx, %rax      # <retval>,
        xorl    %edx, %edx      #
        xorl    %esi, %esi      #
        xorl    %edi, %edi      #
        ret
        .size   stpcpy, .-stpcpy
        .align 16

No idea why it got inserted here, or why it only shows up in these
two functions. Having a nop before the endbr is a compiler bug, right?

Attaching the preprocessed file and .s file as well here.
This is the compiler command I used:

/home/arnd/cross/arm64/gcc-14.2.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc -Wp,-MMD,lib/.string.s.d -nostdinc -I/home/arnd/arm-soc/arch/x86/include -I./arch/x86/include/generated -I/home/arnd/arm-soc/include -I./include -I/home/arnd/arm-soc/arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I/home/arnd/arm-soc/include/uapi -I./include/generated/uapi -include /home/arnd/arm-soc/include/linux/compiler-version.h -include /home/arnd/arm-soc/include/linux/kconfig.h -include /home/arnd/arm-soc/include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=/home/arnd/arm-soc/= -Werror -DKCONFIG_SEED= -std=gnu2x -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=branch -fno-jump-tables -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mindirect-branch-cs-prefix -fno-jump-tables -fno-delete-null-pointer-checks -O2 -fno-allow-store-data-races -fstack-protector -fomit-frame-pointer -ftrivial-auto-var-init=zero -fno-stack-clash-protection -fzero-call-used-regs=used-gpr -fno-inline-functions-called-once -fmin-function-alignment=16 -fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=2048 -Wunused-const-variable -Wno-dangling-pointer -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-overflow -Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wenum-conversion -Wextra -Wunused -Wformat-security -Wno-unused-but-set-variable -Wno-packed-not-aligned -Wno-format-overflow -Wno-format-truncation -Wno-override-init -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -Werror -DKCONFIG_SEED= -ffreestanding -I/home/arnd/arm-soc/lib -Ilib -DKBUILD_MODFILE='"lib/string"' -DKBUILD_BASENAME='"string"' -DKBUILD_MODNAME='"string"' -D__KBUILD_MODNAME=kmod_string -fverbose-asm -S -o lib/string.s /home/arnd/arm-soc/lib/string.c

      Arnd
Download attachment "string.s.gz" of type "application/gzip" (10419 bytes)

Download attachment "string.i.gz" of type "application/gzip" (22429 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ