Received: by 10.223.176.5 with SMTP id f5csp1017466wra; Fri, 2 Feb 2018 09:46:54 -0800 (PST) X-Google-Smtp-Source: AH8x225tVTAOZ9cZsq5r24h/2qVpgEqL7PxQplUs+NaPPi9nEBiUEjJWtKyx5kGFT6ujyfXG9Zb3 X-Received: by 2002:a17:902:4464:: with SMTP id k91-v6mr7927160pld.267.1517593614095; Fri, 02 Feb 2018 09:46:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517593614; cv=none; d=google.com; s=arc-20160816; b=nmcxb2p/XfuwejYEmRoKyK5mNNR5Ebk8SJB8WAeOfZUJuUFx0I4DgmUROA94Y565Bk 14LZNYl8kW2IJLUzTbQzZQ3H7kjrGjajAePHnUbxzq7uCNlZzQkIL2XL+WIy+/pAHLxT q1/H2ln7AvgugSBo2LrvPFZCY5RkUwdw075/r41i3lZu4MVn1zzUtfnPgLCV2epI7GGF +aYVDIlfc7QDn86meVaJMH+LAbjAYXwC03CJcVOL7KfPZYX0s3e6pTs+fMUPebwvqHXH kwhCydknz5BLhOziryL4se5ZMzVXSuDb+wv/y7dbfsQOE4cfCfroqrFLVWCqHfw6LHgO FIYg== 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=2Zb8igdi0JyRObo3AwsgrsUyTHKN+wbMZuZdTJmCYsg=; b=Ff+ku5HnTrzlkp9HodSnn/DMxIdLwVp8H4iZrpa3mHBuavdpGp7qsbiPqVl/6bs2FZ doOTKNwVOoZoLWVTTxNQxRq5rugSHJ60GsURZefX6r03SllflgMe5bmrtVpU1PaLkKuU XrpzgwitxOMd5murixhlolHo6fvm4U6HP4NcJp2GZYnhj2gs3SIqg8nFGHLDeU4a3DWt CKcQ2APD18Ts4WZ1a8pfat7m/7JCGmB0NWVw9R69AHsGL4MGSeUfzZ+DjuFenj/UKsia GuGaCj+SvmQ2Fl+j3RimgAoPKyhEblueA5/6xVtoQPfof3Sc2gx3kxsTuRsq4bHqfq02 WvGQ== 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 i3-v6si2191298plt.369.2018.02.02.09.46.39; Fri, 02 Feb 2018 09:46:54 -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 S1753857AbeBBRpp (ORCPT + 99 others); Fri, 2 Feb 2018 12:45:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40520 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753635AbeBBROb (ORCPT ); Fri, 2 Feb 2018 12:14:31 -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 98060ED5; Fri, 2 Feb 2018 17:14:29 +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.14 137/156] USB: serial: io_edgeport: fix possible sleep-in-atomic Date: Fri, 2 Feb 2018 17:58:38 +0100 Message-Id: <20180202140846.572241771@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@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.14-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 @@ -2286,7 +2286,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;