diff --git a/drivers/video/tegra/nvmap/nvmap_dmabuf.c b/drivers/video/tegra/nvmap/nvmap_dmabuf.c index eba99bc5..b979e46f 100644 --- a/drivers/video/tegra/nvmap/nvmap_dmabuf.c +++ b/drivers/video/tegra/nvmap/nvmap_dmabuf.c @@ -376,6 +376,15 @@ static int __nvmap_map(struct nvmap_handle *h, struct vm_area_struct *vma) return -EPERM; } + /* + * Don't allow executable mappings. + */ + if (vma->vm_flags & VM_EXEC) { + pr_err("executable mappings not allowed\n"); + nvmap_handle_put(h); + return -EPERM; + } + /* * If the handle is RO and RW mapping is requested, then * return error.