mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-27 22:51:31 +00:00
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/1 Signed-off-by: Lao Wei <zrlw@qq.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
0af04934be
commit
eac7230fdb
1 changed files with 1 additions and 1 deletions
|
@ -1460,7 +1460,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma)
|
|||
unsigned long page, pos;
|
||||
|
||||
mutex_lock(&meye.lock);
|
||||
if (size > gbuffers * gbufsize) {
|
||||
if (size > gbuffers * gbufsize || offset > gbuffers * gbufsize - size) {
|
||||
mutex_unlock(&meye.lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue