summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv/etnaviv_gem.c
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2017-06-06 09:17:06 +0200
committerLucas Stach <l.stach@pengutronix.de>2017-07-03 10:54:52 +0200
commit6cbf04001ec0eede72a43f297c93586971445128 (patch)
tree255e93e717a0a14f05626a0ef8556de94df5e8ab /drivers/gpu/drm/etnaviv/etnaviv_gem.c
parent12d016626f99f48edbf5b006625b4e8c0de1eec7 (diff)
downloadop-kernel-dev-6cbf04001ec0eede72a43f297c93586971445128.zip
op-kernel-dev-6cbf04001ec0eede72a43f297c93586971445128.tar.gz
drm/etnaviv: don't trigger OOM killer when page allocation fails
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>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gem.c')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 9a3bea7..b7541a4 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -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)
OpenPOWER on IntegriCloud