]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: intel: skl: Fix possible buffer overflow in debug outputs
authorTakashi Iwai <tiwai@suse.de>
Tue, 18 Feb 2020 11:17:36 +0000 (12:17 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 19 Feb 2020 13:36:15 +0000 (13:36 +0000)
commitb47cb1767e93f5500dc863979ca12c7a2067eebf
tree0e66fe0cbc446d87e456917cfa950a523f593acf
parentca30c14e950fb435a6d7302e3ad568beab0d4c4e
ASoC: intel: skl: Fix possible buffer overflow in debug outputs

The debugfs output of intel skl driver writes strings with multiple
snprintf() calls with the fixed size.  This was supposed to avoid the
buffer overflow but actually it still would, because snprintf()
returns the expected size to be output, not the actual output size.

Fix it by replacing snprintf() calls with scnprintf().

Fixes: e19d60e50b6a ("ASoC: Intel: Skylake: Debugfs facility to dump module config")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200218111737.14193-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/skylake/skl-debug.c