Commit eac7230f authored by Lao Wei's avatar Lao Wei Committed by Mauro Carvalho Chehab

media: fix: media: pci: meye: validate offset to avoid arbitrary access

Motion eye video4linux driver for Sony Vaio PictureBook desn't validate user-controlled parameter
'vma->vm_pgoff', a malicious process might access all of kernel memory from user space by trying
pass different arbitrary address.
Discussion: http://www.openwall.com/lists/oss-security/2018/07/06/1Signed-off-by: default avatarLao Wei <zrlw@qq.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 0af04934
...@@ -1460,7 +1460,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -1460,7 +1460,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma)
unsigned long page, pos; unsigned long page, pos;
mutex_lock(&meye.lock); mutex_lock(&meye.lock);
if (size > gbuffers * gbufsize) { if (size > gbuffers * gbufsize || offset > gbuffers * gbufsize - size) {
mutex_unlock(&meye.lock); mutex_unlock(&meye.lock);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment