From: Greg Kroah-Hartman Date: Thu, 23 Jan 2020 10:36:25 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v5.4.15~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce2dc9831063d5c3c8ac4c23cdb3e9bfafc3bf72;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: drm-i915-fix-pid-leak-with-banned-clients.patch --- diff --git a/queue-5.4/drm-i915-fix-pid-leak-with-banned-clients.patch b/queue-5.4/drm-i915-fix-pid-leak-with-banned-clients.patch new file mode 100644 index 00000000000..e358a39edaf --- /dev/null +++ b/queue-5.4/drm-i915-fix-pid-leak-with-banned-clients.patch @@ -0,0 +1,42 @@ +From f0f3a6cecf3b98990985cd42f7bf5a0313894822 Mon Sep 17 00:00:00 2001 +From: Tvrtko Ursulin +Date: Tue, 17 Dec 2019 17:09:33 +0000 +Subject: drm/i915: Fix pid leak with banned clients + +From: Tvrtko Ursulin + +commit f0f3a6cecf3b98990985cd42f7bf5a0313894822 upstream. + +Get_pid_task() needs to be paired with a put_pid or we leak a pid +reference every time a banned client tries to create a context. + +v2: + * task_pid_nr helper exists! (Chris) + +Signed-off-by: Tvrtko Ursulin +Fixes: b083a0870c79 ("drm/i915: Add per client max context ban limit") +Cc: Chris Wilson +Cc: Mika Kuoppala +Reviewed-by: Chris Wilson +Signed-off-by: Chris Wilson +Link: https://patchwork.freedesktop.org/patch/msgid/20191217170933.8108-1-tvrtko.ursulin@linux.intel.com +(cherry picked from commit ba16a48af797db124ac100417f9229b1650ce1fb) +Signed-off-by: Joonas Lahtinen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c ++++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c +@@ -2094,8 +2094,7 @@ int i915_gem_context_create_ioctl(struct + ext_data.fpriv = file->driver_priv; + if (client_is_banned(ext_data.fpriv)) { + DRM_DEBUG("client %s[%d] banned from creating ctx\n", +- current->comm, +- pid_nr(get_task_pid(current, PIDTYPE_PID))); ++ current->comm, task_pid_nr(current)); + return -EIO; + } + diff --git a/queue-5.4/series b/queue-5.4/series new file mode 100644 index 00000000000..f319567864e --- /dev/null +++ b/queue-5.4/series @@ -0,0 +1 @@ +drm-i915-fix-pid-leak-with-banned-clients.patch