]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/etnaviv: don't trigger OOM killer when page allocation fails
authorLucas Stach <dev@lynxeye.de>
Tue, 6 Jun 2017 07:17:06 +0000 (09:17 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 3 Jul 2017 08:54:52 +0000 (10:54 +0200)
GPU buffers can be quite large, so userspace is expected to deal with
allocation failure. Don't trigger the OOM killer when page allocation for
the GEM objects fails, as this opens an easy possiblity for unprivileged
applications to DOS the system,a s the shmem pages are not fully accounted
to the allocating process.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
drivers/gpu/drm/etnaviv/etnaviv_gem.c

index 9a3bea738330208841b4e2a7a50aa73f8999c64d..b7541a455451718892b5db0cba8f7821f8c23761 100644 (file)
@@ -662,7 +662,8 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
                 * going to pin these pages.
                 */
                mapping = obj->filp->f_mapping;
-               mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
+               mapping_set_gfp_mask(mapping, GFP_HIGHUSER |
+                                    __GFP_NORETRY | __GFP_NOWARN);
        }
 
        if (ret)