From nobody Fri Dec 19 00:21:36 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 43C0D253F26; Tue, 25 Mar 2025 08:34:55 +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=1742891698; cv=none; b=ifilaXmZCNCghRZ3reCbQu5D1f9X0CqdZ3Rkv+PsrhCt9rXyr1fkjyIXKM8q203MADSqqzny6GSZIMt+0JGYkBhe+csDIWI3tP8eZY0nB/4rvmteAozgaQ9zl5DyuCU9eZH1uj//wnKeGm3ERjWY12b40EaYPSqqPnoH6DGAV58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742891698; c=relaxed/simple; bh=1e02s10vS1f5JzpRohx6MjTdbl+34tMrqfcqMwDNmL0=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=jsSgKMgvlb4utsx1ibc4YB02uaZ6Ug7zqRmMafjrkSIwRlINzbg5fye5mBJW3/RYJ5FG+n6nMmieyRzhE4iTlsGimSKNiNt2xI0BaVuuemI/0hQoOYn3ZJrutmKiC7rYNE2nAeGJnO82quA/Z5rZYEp1UiiuiFU3RdzLGqQUfvk= 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=zRl1Zbjy; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bqDJpwpG; 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="zRl1Zbjy"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bqDJpwpG" Date: Tue, 25 Mar 2025 08:34:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742891694; 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=unICu+bPInITr/K60G497hc/J6Up9DEnDRMTlpJsgSk=; b=zRl1Zbjyn7vwSnZmdg7guYmRkjHt/IDqTPyWz4XERiEK/sXg3UiIpKjxLTFqCIw+wjwLwr sLNHKmppMmNBd/3syQaKI/IRE0T/LlTRwJRuiGGc9rClOZNazLVZhJmBRrgDI5dOmOQbrS vny5CWRExDbTzqDacmyzo1QuDJzGjgReCygA1HShvy5gbB3cjqB3kqC8S3a1DNjsWQRqNz aIO9bp2l0D4DDl+0CpIuWRe5MrO2MPu3W/zsAZ9FQ4opCNOXldhzdkF2WAEtMP7GKAlPfk EQfpuXfT+gwrTuGrQQ6hjHYKii1MuZ3RlMvrevrcHehNOdP9CXQV+rYjcRYD1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742891694; 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=unICu+bPInITr/K60G497hc/J6Up9DEnDRMTlpJsgSk=; b=bqDJpwpGGTffKLyGFPNMVCqp7CON6CTIOHohhRvUMNMwP1I3YcpRhkKC2o59ehi0k5jZ2d slrpnKQUiazwirBw== 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 , Srinivas Kandagatla , Liam Girdwood , Mark Brown , 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: <174289169388.14745.12400458342392826127.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: 46b70c569b774ea2c671bb3aff2a50d29760b7c3 Gitweb: https://git.kernel.org/tip/46b70c569b774ea2c671bb3aff2a50d29= 760b7c3 Author: Josh Poimboeuf AuthorDate: Mon, 24 Mar 2025 14:56:09 -07:00 Committer: Ingo Molnar CommitterDate: Tue, 25 Mar 2025 09:20:29 +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 Cc: Srinivas Kandagatla Cc: Liam Girdwood Cc: Mark Brown 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/ Acked-by: Mark Brown --- 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;