linux-yocto/sound
Josh Poimboeuf 1640c9b81d objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler()
[ Upstream commit 060aed9c0093b341480770457093449771cf1496 ]

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 <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Mark Brown <broonie@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/7e863839ec7301bf9c0f429a03873d44e484c31c.1742852847.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202503180044.oH9gyPeg-lkp@intel.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-02 07:44:35 +02:00
..
ac97
aoa
arm
atmel
core ALSA: pcm: Avoid reference to status->state 2024-12-14 19:51:30 +01:00
drivers
firewire ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init() 2024-11-14 13:13:37 +01:00
hda ASoC: Intel: sst: Support LPE0F28 ACPI HID 2024-12-14 19:50:39 +01:00
i2c
isa
mips
oss
parisc
pci ALSA: hda: intel: Fix Optimus when GPU has no sound 2025-05-02 07:43:54 +02:00
pcmcia
ppc
sh ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs 2024-04-10 16:19:32 +02:00
soc objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler() 2025-05-02 07:44:35 +02:00
sparc
spi
synth ALSA: emux: improve patch ioctl data validation 2024-07-05 09:14:43 +02:00
usb ALSA: usb-audio: Fix CME quirk for UF series keyboards 2025-05-02 07:43:54 +02:00
virtio sound/virtio: Fix cancel_sync warnings on uninitialized work_structs 2025-05-02 07:44:35 +02:00
x86
xen
ac97_bus.c
Kconfig sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML 2024-11-17 15:06:25 +01:00
last.c
Makefile
sound_core.c