]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs
authorTakashi Iwai <tiwai@suse.de>
Tue, 18 Feb 2020 09:14:09 +0000 (10:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 16:22:12 +0000 (17:22 +0100)
commit4f249aa855e3ab1ead640f1ed2fed1ed0b93995b
tree08aeda98c30d25ba4aca722413b7a70ca9bf6ddb
parente9b9e62eb0711e685adbd26609c3659dd9bea2c1
ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs

commit 9cb0be74d16b863d86d13831c3b85a52a88477da upstream.

Some code in HD-audio driver calls snprintf() in a loop and still
expects that the return value were actually written size, while
snprintf() returns the expected would-be length instead.  When the
given buffer limit were small, this leads to a buffer overflow.

Use scnprintf() for addressing those issues.  It returns the actually
written size unlike snprintf().

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200218091409.27162-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/hda/hdmi_chmap.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_eld.c
sound/pci/hda/hda_sysfs.c