Message ID | 20241017171829.2040531-1-sherry.yang@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [6.1.y,5.15.y] drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE) | expand |
On Thu, Oct 17, 2024 at 10:18:29AM -0700, Sherry Yang wrote: > From: "Wachowski, Karol" <karol.wachowski@intel.com> > > commit 39bc27bd688066a63e56f7f64ad34fae03fbe3b8 upstream. Now queued up, thanks. greg k-h
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index e33f06bb66eb..fb8093577245 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -638,6 +638,9 @@ int drm_gem_shmem_mmap(struct drm_gem_shmem_object *shmem, struct vm_area_struct return ret; } + if (is_cow_mapping(vma->vm_flags)) + return -EINVAL; + ret = drm_gem_shmem_get_pages(shmem); if (ret) return ret;