Received: by 10.223.176.5 with SMTP id f5csp1058136wra; Fri, 2 Feb 2018 10:26:39 -0800 (PST) X-Google-Smtp-Source: AH8x225+0zdgEdLklkzsovGMqAbufLOdLI6de8nyIbucknNZ28MkWTypv+/ugxxOME9zRNgIzYjv X-Received: by 10.99.153.1 with SMTP id d1mr22276272pge.190.1517595999485; Fri, 02 Feb 2018 10:26:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517595999; cv=none; d=google.com; s=arc-20160816; b=G6iEU0rOkIhQNErX9Qp0+IGuyNiWQapRGluuMroQOCAMUJL1N6gHYBTGRieHNd67Ja 0RF5sqwaiSZz1OKHQIoALsp2kiFhLonm85qtNXmAlKclQbOjjQsISKv9I3FGH/7tNlxY JfJT7TG2wi07r1JwcyaW2GJyR0IJcgWFda6X3wUOSJr5YDI6bgRixqXfA6xnSI1GctVI O0qiCQmqHD7V/qbdWGOwoLihFm/05ie0X/JPUWuojoUM49urB8q8UWQHVXQ3JnKLri99 evw4wkEZan0VSxe5SRJinXdNIZEj71w41agq7UJHXMRaBVqK8HcwieSfy90IE7XQB2DU 7faw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=k0GqFqEzJHtmb08p0s/k+15hv7pmeaKFGv3gG3wvK2U=; b=zNmyahwcO359nL5kALpPrGCOZPFlYqgwIkzoQQCY1q1oFs6t7J0Mo6QxITk48yaAZF DwKTlanv1HN3ky/7kgRPCJsqQi6iRqhlrRbfHUAqKzEBjNx7MDN5DQTcr63efjTW8sKi uMuwZ7XUQbqPJkESZWsDiKhm56keGM6qYdiVxhNNpLkv/coqPVSCGCOWXFR4YpJXqsQK 0C3KaUf4qjQfdQNQmd7Ww+0cwy7+J8wXkCMC27k+aHidn7Lu1DItINnZC4LpKs5zOaJM yECfjbhuM6Jo2GFmI3hiGksfUht2oj+Sw/NoWlygee6oHzTiHXR3EioalGNUzTnTC2x7 +RwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94-v6si2293543ple.298.2018.02.02.10.26.25; Fri, 02 Feb 2018 10:26:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754692AbeBBSZU (ORCPT + 99 others); Fri, 2 Feb 2018 13:25:20 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35324 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbeBBRCF (ORCPT ); Fri, 2 Feb 2018 12:02:05 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8856DDFF; Fri, 2 Feb 2018 17:02:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jia-Ju Bai , Johan Hovold Subject: [PATCH 4.4 59/67] USB: serial: io_edgeport: fix possible sleep-in-atomic Date: Fri, 2 Feb 2018 17:58:28 +0100 Message-Id: <20180202140821.795512462@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140815.091718203@linuxfoundation.org> References: <20180202140815.091718203@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jia-Ju Bai commit c7b8f77872c73f69a16528a9eb87afefcccdc18b upstream. According to drivers/usb/serial/io_edgeport.c, the driver may sleep under a spinlock. The function call path is: edge_bulk_in_callback (acquire the spinlock) process_rcvd_data process_rcvd_status change_port_settings send_iosp_ext_cmd write_cmd_usb usb_kill_urb --> may sleep To fix it, the redundant usb_kill_urb() is removed from the error path after usb_submit_urb() fails. This possible bug is found by my static analysis tool (DSAC) and checked by my code review. Signed-off-by: Jia-Ju Bai Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/io_edgeport.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -2219,7 +2219,6 @@ static int write_cmd_usb(struct edgeport /* something went wrong */ dev_err(dev, "%s - usb_submit_urb(write command) failed, status = %d\n", __func__, status); - usb_kill_urb(urb); usb_free_urb(urb); atomic_dec(&CmdUrbs); return status;