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: <2983242.e9J7NaK4W3@natalenko.name>
Date: Mon, 07 Apr 2025 23:49:35 +0200
From: Oleksandr Natalenko <oleksandr@...alenko.name>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: linux-kernel@...r.kernel.org,
 Przemek Kitszel <przemyslaw.kitszel@...el.com>, netdev@...r.kernel.org,
 intel-wired-lan@...ts.osuosl.org, Paolo Abeni <pabeni@...hat.com>,
 Jakub Kicinski <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
 "David S. Miller" <davem@...emloft.net>, Andrew Lunn <andrew+netdev@...n.ch>,
 Tony Nguyen <anthony.l.nguyen@...el.com>,
 Peter Zijlstra <peterz@...radead.org>
Subject: Re: objtool warning in ice_free_prof_mask

Hello.

On pondělí 7. dubna 2025 23:42:51, středoevropský letní čas Josh Poimboeuf wrote:
> On Mon, Apr 07, 2025 at 11:21:27AM +0200, Oleksandr Natalenko wrote:
> > It's not a new warning, I've observe it for several recent major kernel releases already.
> > 
> > I do not build with CONFIG_COMPILE_TEST.
> > 
> > I've also realised I see this warning with -O3 only. I know this is
> > unsupported, so feel free to ignore me, but I do -O3 builds for
> > finding out possible loose ends in the code, and this is the only
> > place where it breaks.
> > 
> > > > ```
> > > > drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.isra.0() falls through to next function ice_free_flow_profs.cold()
> > > > drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.isra.0.cold() is missing an ELF size annotation
> > > > ```
> > > > 
> > > > If I mark ice_write_prof_mask_reg() as noinline, this warning disappears.
> > > > 
> > > > Any idea what's going wrong?
> 
> This type of error usually means some type of undefined behavior.  Can
> you share your config?  No guarantees since it is -O3 after all, but I
> can still take a look to see if it's pointing to a bug of some kind.

Sure, thank you for looking into this.

Here's my recipe to reproduce the issue:

1. expose -O3

```
diff --git a/Makefile b/Makefile
index 38689a0c36052..5ce5b44fa1496 100644
--- a/Makefile
+++ b/Makefile
@@ -858,6 +858,9 @@ KBUILD_CFLAGS	+= -fno-delete-null-pointer-checks
 ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
 KBUILD_CFLAGS += -O2
 KBUILD_RUSTFLAGS += -Copt-level=2
+else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
+KBUILD_CFLAGS += -O3
+KBUILD_RUSTFLAGS += -Copt-level=3
 else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 KBUILD_CFLAGS += -Os
 KBUILD_RUSTFLAGS += -Copt-level=s
diff --git a/init/Kconfig b/init/Kconfig
index dd2ea3b9a7992..03b1d768d1a55 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1481,6 +1481,12 @@ config CC_OPTIMIZE_FOR_PERFORMANCE
 	  with the "-O2" compiler flag for best performance and most
 	  helpful compile-time warnings.
 
+config CC_OPTIMIZE_FOR_PERFORMANCE_O3
+	bool "Optimize more for performance (-O3)"
+	help
+	  Choosing this option will pass "-O3" to your compiler to optimize
+	  the kernel yet more for performance.
+
 config CC_OPTIMIZE_FOR_SIZE
 	bool "Optimize for size (-Os)"
 	help
```

2. use this config with v6.15-rc1: https://paste.voidband.net/2BVaYDQS.txt

3. compile:

```
$ make drivers/net/ethernet/intel/ice/ice.o
…
  LD [M]  drivers/net/ethernet/intel/ice/ice.o
drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.isra.0() falls through to next function ice_free_flow_profs.cold()
drivers/net/ethernet/intel/ice/ice.o: error: objtool: ice_free_prof_mask.isra.0.cold() is missing an ELF size annotation
…
```

-- 
Oleksandr Natalenko, MSE
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ