From nobody Fri Dec 19 00:18:31 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE804269B15; Tue, 25 Mar 2025 22:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742940599; cv=none; b=oItBt05ZNdjNliBVQy2vxsBkE6B4j6ve++5c2jxSFIc9mKW5+zLq8tuuI3xnAqxikibfMBL4EzU2FV+u3ha2irZyNFjw/XZytMT2o2dUN4oJ95nWEzGq375abnyAYxqkj0V9MB/8m+NHJ3+44qxHS2Zqe/BqcCk/N2LtTy3Eb1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742940599; c=relaxed/simple; bh=LcgEJCgtJNy9KBfxvaVujmxOmhVHa5e6l+9bGtef+b4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=OdeQbkY6IpEKq8ZJDXrfZYBsRaxludoHas8fbtO4zj9BN/pazcMbF6DRHInyZIgwYQz4CI1cmojYEu2pmOrwBt5CV7yK7pTyr9GfiP/gZC5yVULHtU4KnK/Iw6FGSRSqsBtvC4GS0CcA2aABkadeO+z4A3a4jlQF8jNUzGrHERE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=GhPX+szH; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=4BGtmgb7; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GhPX+szH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4BGtmgb7" Date: Tue, 25 Mar 2025 22:09:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742940596; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R799+7hFsRSTNHCY+rBMnQpO9gXCjfa8dKZVlmr+oHI=; b=GhPX+szHG4P20zbSnLwbxBTgrvg8MkUbQKeorSxvAbuAeCHpo3H/rz8gqRu4rppZkHEnF8 hNRH4KQs1N44A9iXfHfMMJpjPgrCv7LqOVU9HmhyqKEBTMdqZUNVz6tLnm1XK+QbwJuFL1 a1VToASGCQS8kgBe/wThBqqx2nT1viNTRmvvtthhJl6MmbvAX9W+SJZbwynJJeIJeqtE8A JPDyNvvbp184CTdCBjX6aUYFP+2/EKU+f5PDEtCHwEWoNkrNLUgnWPp5R3W6mL7nID5d8X oB5gCcDX08Df0cYo2685/BlztILvJOFz3nuva3f68k0QyvEiZD+u8GItX9/ZAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742940596; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R799+7hFsRSTNHCY+rBMnQpO9gXCjfa8dKZVlmr+oHI=; b=4BGtmgb7zIZGAHQfEPgVRKaKBf7ut6f34ulVbg/0iSQeuI6TYELHKOITds//vfHoolDDOZ ozaUfI+zQWuTqlCw== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/urgent] objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler() Cc: kernel test robot , Josh Poimboeuf , Ingo Molnar , Mark Brown , Srinivas Kandagatla , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <7e863839ec7301bf9c0f429a03873d44e484c31c.1742852847.git.jpoimboe@kernel.org> References: <7e863839ec7301bf9c0f429a03873d44e484c31c.1742852847.git.jpoimboe@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174294059560.14745.3576508720300884600.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 060aed9c0093b341480770457093449771cf1496 Gitweb: https://git.kernel.org/tip/060aed9c0093b34148077045709344977= 1cf1496 Author: Josh Poimboeuf AuthorDate: Mon, 24 Mar 2025 14:56:09 -07:00 Committer: Ingo Molnar CommitterDate: Tue, 25 Mar 2025 23:00:16 +01:00 objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd9= 34x_slim_irq_handler() If 'port_id' is negative, the shift counts in wcd934x_slim_irq_handler() also become negative, resulting in undefined behavior due to shift out of bounds. If I'm reading the code correctly, that appears to be not possible, but with KCOV enabled, Clang's range analysis isn't always able to determine that and generates undefined behavior. As a result the code generation isn't optimal, and undefined behavior should be avoided regardless. Improve code generation and remove the undefined behavior by converting the signed variables to unsigned. Fixes the following warning with UBSAN: sound/soc/codecs/snd-soc-wcd934x.o: warning: objtool: .text.wcd934x_slim_= irq_handler: unexpected end of section Reported-by: kernel test robot Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Acked-by: Mark Brown Cc: Srinivas Kandagatla Cc: Liam Girdwood Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Linus Torvalds Link: https://lore.kernel.org/r/7e863839ec7301bf9c0f429a03873d44e484c31c.17= 42852847.git.jpoimboe@kernel.org Closes: https://lore.kernel.org/oe-kbuild-all/202503180044.oH9gyPeg-lkp@int= el.com/ --- sound/soc/codecs/wcd934x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index 910852e..c7f1b28 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -2273,7 +2273,7 @@ static irqreturn_t wcd934x_slim_irq_handler(int irq, = void *data) { struct wcd934x_codec *wcd =3D data; unsigned long status =3D 0; - int i, j, port_id; + unsigned int i, j, port_id; unsigned int val, int_val =3D 0; irqreturn_t ret =3D IRQ_NONE; bool tx;