From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:39092 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbdJEIt7 (ORCPT ); Thu, 5 Oct 2017 04:49:59 -0400 Subject: Patch "drm/amdkfd: fix improper return value on error" has been added to the 4.4-stable tree To: bianpan2016@163.com, alexander.levin@verizon.com, gregkh@linuxfoundation.org, oded.gabbay@gmail.com Cc: , From: Date: Thu, 05 Oct 2017 10:49:51 +0200 Message-ID: <1507193391105243@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled drm/amdkfd: fix improper return value on error to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-amdkfd-fix-improper-return-value-on-error.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Oct 5 10:49:14 CEST 2017 From: Pan Bian Date: Thu, 1 Dec 2016 16:10:42 +0800 Subject: drm/amdkfd: fix improper return value on error From: Pan Bian [ Upstream commit 8bf793883da213864efc50c274d2b38ec0ca58b2 ] In function kfd_wait_on_events(), when the call to copy_from_user() fails, the value of return variable ret is 0. 0 indicates success, which is inconsistent with the execution status. This patch fixes the bug by assigning "-EFAULT" to ret when copy_from_user() returns an unexpected value. Signed-off-by: Pan Bian Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c @@ -739,8 +739,10 @@ int kfd_wait_on_events(struct kfd_proces struct kfd_event_data event_data; if (copy_from_user(&event_data, &events[i], - sizeof(struct kfd_event_data))) + sizeof(struct kfd_event_data))) { + ret = -EFAULT; goto fail; + } ret = init_event_waiter(p, &event_waiters[i], event_data.event_id, i); Patches currently in stable-queue which might be from bianpan2016@163.com are queue-4.4/team-fix-memory-leaks.patch queue-4.4/drm-amdkfd-fix-improper-return-value-on-error.patch