From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:60840 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754079AbdJIMgf (ORCPT ); Mon, 9 Oct 2017 08:36:35 -0400 Subject: Patch "uwb: properly check kthread_run return value" has been added to the 3.18-stable tree To: andreyknvl@google.com, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 09 Oct 2017 14:36:32 +0200 Message-ID: <1507552592204243@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 uwb: properly check kthread_run return value to the 3.18-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: uwb-properly-check-kthread_run-return-value.patch and it can be found in the queue-3.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From bbf26183b7a6236ba602f4d6a2f7cade35bba043 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Thu, 14 Sep 2017 14:30:55 +0200 Subject: uwb: properly check kthread_run return value From: Andrey Konovalov commit bbf26183b7a6236ba602f4d6a2f7cade35bba043 upstream. uwbd_start() calls kthread_run() and checks that the return value is not NULL. But the return value is not NULL in case kthread_run() fails, it takes the form of ERR_PTR(-EINTR). Use IS_ERR() instead. Also add a check to uwbd_stop(). Signed-off-by: Andrey Konovalov Signed-off-by: Greg Kroah-Hartman --- drivers/uwb/uwbd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/uwb/uwbd.c +++ b/drivers/uwb/uwbd.c @@ -303,18 +303,22 @@ static int uwbd(void *param) /** Start the UWB daemon */ void uwbd_start(struct uwb_rc *rc) { - rc->uwbd.task = kthread_run(uwbd, rc, "uwbd"); - if (rc->uwbd.task == NULL) + struct task_struct *task = kthread_run(uwbd, rc, "uwbd"); + if (IS_ERR(task)) { + rc->uwbd.task = NULL; printk(KERN_ERR "UWB: Cannot start management daemon; " "UWB won't work\n"); - else + } else { + rc->uwbd.task = task; rc->uwbd.pid = rc->uwbd.task->pid; + } } /* Stop the UWB daemon and free any unprocessed events */ void uwbd_stop(struct uwb_rc *rc) { - kthread_stop(rc->uwbd.task); + if (rc->uwbd.task) + kthread_stop(rc->uwbd.task); uwbd_flush(rc); } Patches currently in stable-queue which might be from andreyknvl@google.com are queue-3.18/usb-fix-out-of-bounds-in-usb_set_configuration.patch queue-3.18/usb-uas-fix-bug-in-handling-of-alternate-settings.patch queue-3.18/alsa-usb-audio-check-out-of-bounds-access-by-corrupted-buffer-descriptor.patch queue-3.18/uwb-properly-check-kthread_run-return-value.patch queue-3.18/usb-dummy-hcd-fix-infinite-loop-resubmission-bug.patch queue-3.18/usb-gadgetfs-fix-copy_to_user-while-holding-spinlock.patch queue-3.18/uwb-ensure-that-endpoint-is-interrupt.patch queue-3.18/usb-gadgetfs-fix-crash-caused-by-inadequate-synchronization.patch