From c6fc836488c2ca45c06d21213f5281d668b42b95 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Wed, 9 Feb 2022 16:56:34 +0100 Subject: [PATCH] drm/gem-shmem: Don't store mmap'ed buffers in core dumps Set the VM_DONTDUMP flag on mmap'ed VMAs to omit them from core dumps. It's display-buffer memory; who knows what secrets these buffers contain. Signed-off-by: Thomas Zimmermann Reviewed-by: Chia-I Wu Link: https://patchwork.freedesktop.org/patch/msgid/20220209155634.3994-3-tzimmermann@suse.de --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 5991a22..bda06bd 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -623,7 +623,7 @@ int drm_gem_shmem_mmap(struct drm_gem_shmem_object *shmem, struct vm_area_struct return ret; } - vma->vm_flags |= VM_PFNMAP | VM_DONTEXPAND; + vma->vm_flags |= VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); if (shmem->map_wc) vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); -- 2.7.4