All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/etnaviv: don't trigger OOM killer when page allocation fails
@ 2017-06-06  7:17 Lucas Stach
  2017-06-06  7:17 ` [PATCH 2/3] drm/etnaviv: reduce allocation failure message severity Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Lucas Stach @ 2017-06-06  7:17 UTC (permalink / raw)
  To: Lucas Stach; +Cc: etnaviv, dri-devel, Russell King

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index f0efc5d..4c53508 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)
-- 
2.9.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-06-26  6:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06  7:17 [PATCH 1/3] drm/etnaviv: don't trigger OOM killer when page allocation fails Lucas Stach
2017-06-06  7:17 ` [PATCH 2/3] drm/etnaviv: reduce allocation failure message severity Lucas Stach
2017-06-06  7:17 ` [PATCH 3/3] drm/etnaviv: populate GEM objects on cpu_prep Lucas Stach
2017-06-20  9:06 ` [PATCH 1/3] drm/etnaviv: don't trigger OOM killer when page allocation fails Daniel Vetter
2017-06-20  9:22   ` Lucas Stach
2017-06-20  9:25     ` Daniel Vetter
2017-06-26  5:52       ` Michal Hocko
2017-06-26  6:48         ` Lucas Stach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.