Received: by 10.223.176.5 with SMTP id f5csp999374wra; Fri, 2 Feb 2018 09:28:41 -0800 (PST) X-Google-Smtp-Source: AH8x22405FQ+aRg0Yf2Nzfs4H6NkuQe4Vf95OaGWPq3iYUovXRcCE34EDVtyMOwwCwwrvibUqcct X-Received: by 2002:a17:902:b595:: with SMTP id a21-v6mr15446444pls.253.1517592521521; Fri, 02 Feb 2018 09:28:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517592521; cv=none; d=google.com; s=arc-20160816; b=b5aOjC7yxg9scOFtLN7znTGyCzWTPX67z3PowKhV/LTrXkFDmLSUtOynKoNZH7Wauh QFWd3II6FW278T2Ha/xyUIiAPyL0gOtK1RjsFksogLb4aG+zbTVQgKZrL9nMdYJHum3r NN44TOR5NDxV2ZsGgHtQTgl9CMGsi1xcXPBdbWoafuj6i0gQ9hK7E163vEbJ+zgffOpx NZDc+NA/qNPuvio5Z3S+E1JQNkFWTGi2c4yuRYq9z8JN2aPkd8RdqidF+olPvD4+XXro dB9QbrX7ge/7jH2rV+lbp9pEoyrwZqozEBuVNWQPetQQBj5F4FQiBwy8iz+kzR+fObmA KNVg== 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=/UX3JrImn0krhapV61wzoZ3T2EgmkCztxbLOD4MNpkI=; b=JvODDo7FPZ1YA+iwLs4bIuI74irS+L6A1RA0Ch5iHOaU1SO8Lo0/eqv8x1A3VcdZzJ sZju7A0AMWlSr7r/b3/LFfmg0BFu8wKhtq+V69aPn+DtbUYGNvy38fZYAjAjpO2u53mp mEPxd9LVFuJ+edV5pvoH5Gx1r7cWt2bUB6oiLUTARlgCjFQMdhq2PyMLMC7F5TmuEzvk g1WvEAMP/FQ1D8DJW6xxqySBT5f9dFE6V+67g3vytpBKrERxWlt28RGGE7dXkEVaGnAF uZDtmeKX6BgGAfIDXGdxTrnDzerLQ7/6nR2tKdnus1bZlzbBlAXtCzQ2g9sVqet6FM1x dR0g== 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 h12-v6si78702plt.241.2018.02.02.09.28.26; Fri, 02 Feb 2018 09:28:41 -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 S1753355AbeBBR1S (ORCPT + 99 others); Fri, 2 Feb 2018 12:27:18 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40896 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753612AbeBBRQA (ORCPT ); Fri, 2 Feb 2018 12:16:00 -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 9D401F24; Fri, 2 Feb 2018 17:15:59 +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.15 35/55] USB: serial: io_edgeport: fix possible sleep-in-atomic Date: Fri, 2 Feb 2018 17:58:53 +0100 Message-Id: <20180202140829.651185281@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140826.117602411@linuxfoundation.org> References: <20180202140826.117602411@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.15-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 @@ -2282,7 +2282,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;