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: <6nzfoyak4cewjpmdflg5yi7jh2mqqdsfqgljoolx5lvdo2p65p@rwjfl7cqkfoo>
Date: Mon, 7 Apr 2025 17:14:59 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Oleksandr Natalenko <oleksandr@...alenko.name>
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: [Intel-wired-lan] objtool warning in ice_free_prof_mask

On Mon, Apr 07, 2025 at 11:49:35PM +0200, Oleksandr Natalenko wrote:
> $ 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

Thanks, I was able to recreate.

This is the -O3 optimizer noticing that ice_write_prof_mask_reg() is
only called with ICE_BLK_RSS or ICE_BLK_FD.  So it optimizes out the
impossible 'default' case in this switch statement:

	switch (blk) {
	case ICE_BLK_RSS:
		offset = GLQF_HMASK(mask_idx);
		val = FIELD_PREP(GLQF_HMASK_MSK_INDEX_M, idx);
		val |= FIELD_PREP(GLQF_HMASK_MASK_M, mask);
		break;
	case ICE_BLK_FD:
		offset = GLQF_FDMASK(mask_idx);
		val = FIELD_PREP(GLQF_FDMASK_MSK_INDEX_M, idx);
		val |= FIELD_PREP(GLQF_FDMASK_MASK_M, mask);
		break;
	default:
		ice_debug(hw, ICE_DBG_PKG, "No profile masks for block %d\n",
			  blk);
		return;
	}

Unfortunately, instead of finishing the optimization, it inserts
undefined behavior for the 'default' case by branching off to some
random code.

So there doesn't seem to be any underlying bug, it's just that objtool
doesn't like undefined behavior.

So for building with -O3 I'd recommend just disabling
CONFIG_OBJTOOL_WERROR and ignoring any objtool warnings.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ