Skip to contentSkip to conversation

ALSA: control: fix a mishandled exits in snd_ctl_elem_add

RFC New yangerkun 1 participant 1 message Apr 14, 2020 Sound

lore
Share & tools
lore

yangerkun

author
#0 lore raw

RFC 1/1 ALSA: control: fix a mishandled exits in snd_ctl_elem_add

CVE-2020-11725 report that 'count = info->owner' may result a SIZE_OVERFLOW. 'info->owner' represent a pid, and actually, we should use info->count.

---
 sound/core/control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/control.c +1 -1
index aa0c0cf182af..c77ca7f39637 100644
@@ -1431,7 +1431,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
 		return -ENOMEM;
 
 	/* Check the number of elements for this userspace control. */
-	count = info->owner;
+	count = info->count;
 	if (count == 0)
 		count = 1;
 
Signature · 1 line
2.21.1