ALSA: info: Limit the proc text input size
[firefly-linux-kernel-4.4.55.git] / sound / core / info.c
index dbef9edd4871a7182ac70db79255f6a93ffb1afe..8ab72e0f593292ac91aea0b06b70d89fc084bd3c 100644 (file)
@@ -331,6 +331,9 @@ static ssize_t snd_info_text_entry_write(struct file *file,
        if (!valid_pos(pos, count))
                return -EIO;
        next = pos + count;
+       /* don't handle too large text inputs */
+       if (next > 16 * 1024)
+               return -EIO;
        mutex_lock(&entry->access);
        buf = data->wbuffer;
        if (!buf) {