]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/seq_file.c
fs/seq_file: fix out-of-bounds read
[mirror_ubuntu-artful-kernel.git] / fs / seq_file.c
index 19f532e7d35e9a501256ab64f76a645bf7d6b2e6..6dc4296eed62c5d2a493c5ba3f649c890aa37981 100644 (file)
@@ -223,8 +223,10 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
                size -= n;
                buf += n;
                copied += n;
-               if (!m->count)
+               if (!m->count) {
+                       m->from = 0;
                        m->index++;
+               }
                if (!size)
                        goto Done;
        }