Skip to content

Commit 89e3c42

Browse files
committed
ALSA: hda/ca0132: Fix buffer overflow in add_tuning_control
jira LE-4613 cve CVE-2025-39751 Rebuild_History Non-Buildable kernel-6.12.0-55.41.1.el10_0 commit-author Lucy Thrun <lucy.thrun@digital-rabbithole.de> commit a409c60 The 'sprintf' call in 'add_tuning_control' may exceed the 44-byte buffer if either string argument is too long. This triggers a compiler warning. Replaced 'sprintf' with 'snprintf' to limit string lengths to prevent overflow. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202506100642.95jpuMY1-lkp@intel.com/ Signed-off-by: Lucy Thrun <lucy.thrun@digital-rabbithole.de> Link: https://patch.msgid.link/20250610175012.918-3-lucy.thrun@digital-rabbithole.de Signed-off-by: Takashi Iwai <tiwai@suse.de> (cherry picked from commit a409c60) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 01d05fd commit 89e3c42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/pci/hda/patch_ca0132.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4410,7 +4410,7 @@ static int add_tuning_control(struct hda_codec *codec,
44104410
}
44114411
knew.private_value =
44124412
HDA_COMPOSE_AMP_VAL(nid, 1, 0, type);
4413-
sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
4413+
snprintf(namestr, sizeof(namestr), "%s %s Volume", name, dirstr[dir]);
44144414
return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
44154415
}
44164416

0 commit comments

Comments
 (0)