From 8cc8f168bd54dee8851eea249280e90605420d72 Mon Sep 17 00:00:00 2001 From: fire855 Date: Sat, 8 Apr 2017 22:48:19 +0200 Subject: Fix "Elevation of privilege vulnerability in MediaTek components" CVE-2017-0503 --- sound/soc/mediatek/mt_soc_audio_v2/mt_soc_machine.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/mediatek/mt_soc_audio_v2/mt_soc_machine.c b/sound/soc/mediatek/mt_soc_audio_v2/mt_soc_machine.c index ca5255abd..967e9cdc0 100644 --- a/sound/soc/mediatek/mt_soc_audio_v2/mt_soc_machine.c +++ b/sound/soc/mediatek/mt_soc_audio_v2/mt_soc_machine.c @@ -551,6 +551,10 @@ static ssize_t mt_soc_debug_write(struct file *f, const char __user *buf, long unsigned int regvalue = 0; char delim[] = " ,"; memset((void *)InputString, 0, 256); + + if (count > 256) + count = 256; + if (copy_from_user((InputString), buf, count)) { printk("copy_from_user mt_soc_debug_write count = %zu temp = %s\n", count, InputString); @@ -970,5 +974,3 @@ MODULE_DESCRIPTION("ALSA SoC driver "); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:mt-snd-card"); - - -- cgit v1.2.3