diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2020-07-21 19:02:33 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2020-07-21 19:02:33 -0700 |
| commit | 9b031c86506cef9acae45e61339fcf9deaabb793 (patch) | |
| tree | 9095d638ba9384f86df8d61dcf1f129c082481e1 /kernel/bpf/arraymap.c | |
| parent | 53aab92dec447f93489e07924e310d605a389dea (diff) | |
| parent | 04d5ce620f794f1df69b5f1b9ad62910fea547f1 (diff) | |
Merge branch 'elan-i2c' into next
Bring in update to Elan touchpad driver to support newer touchpads with
higher resolution.
Diffstat (limited to 'kernel/bpf/arraymap.c')
| -rw-r--r-- | kernel/bpf/arraymap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 95d77770353c..1d6120fd5ba6 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -486,7 +486,12 @@ static int array_map_mmap(struct bpf_map *map, struct vm_area_struct *vma) if (!(map->map_flags & BPF_F_MMAPABLE)) return -EINVAL; - return remap_vmalloc_range(vma, array_map_vmalloc_addr(array), pgoff); + if (vma->vm_pgoff * PAGE_SIZE + (vma->vm_end - vma->vm_start) > + PAGE_ALIGN((u64)array->map.max_entries * array->elem_size)) + return -EINVAL; + + return remap_vmalloc_range(vma, array_map_vmalloc_addr(array), + vma->vm_pgoff + pgoff); } const struct bpf_map_ops array_map_ops = { |
