Received: by 10.223.176.5 with SMTP id f5csp981990wra; Fri, 2 Feb 2018 09:13:02 -0800 (PST) X-Google-Smtp-Source: AH8x226v6FI6cmyHm1MuSVmw6BaBky0/fblseGF4ecjCECWr6z1emZHkbxleSmmR33HhFBl6Mh6W X-Received: by 2002:a17:902:7597:: with SMTP id j23-v6mr26363458pll.191.1517591582694; Fri, 02 Feb 2018 09:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517591582; cv=none; d=google.com; s=arc-20160816; b=Yxrjm6lGPwN5Gdkm/jhVxNB0/jdUgVjoEfLIVqwiAD5TzxmEykKMBxls1pyBcqeLkC XVJsZDbAwr7NdqQ1XqrAOF0PTymz+IblIEa7KK7vR2Ek6iNrIvAC5JsSH8R4taTeaovH LIW0EMhsS+BH4JHqT2JptehZHnLIFhn96ngCwN1K9EujxcyRNPiq6AKi/4RSONP9k1uV q3qmZ4AA/m2H9zf0fjHgdELDQkh75EDJiUZjsHEueZueZUlLyZ9vY5dv0AXjG1A47ZFU OZg0SNZ6be2woALF+IdBEoXkJ0TrXesqgyGE9RuN2WqbOQRZVwTjUGIVuI56C8JDBZYH zQ4Q== 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=prigABS2+24XOsdEmsRllpLwvgsSh8peInd4P4uzu+w=; b=bt1e5fMfRbvZUaI+a9qy8dSmAUa/FPdBMDQKTOJk/LyQeTSxAaAV/ilZsA17vPPFB1 uWHWVCEvDy0G9+Io6exB6ztLaPxakptBBZWTjLQHSF3g8ZrdvAW/D3U4138Ov50nKYQo wU/ZJTJkDdsMpEFbaAK7moedNQQPN/OQCm5ZCy43I9VnD3WEwo13SKxcK9zB2+dzBXS/ SvEVTfzdN3EdgD9awF/ov4qXur57sQatqh4pje4iGI+tq5bC+dcCNaPit4GY7DpjSss+ xTehALSRk46toPFnmyE/mUtCM5F8P5filzvRkxhBcy8R/2FVoOzSQSh5eNP+2ZHrPJA1 9/3Q== 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 t6-v6si268290plr.777.2018.02.02.09.12.48; Fri, 02 Feb 2018 09:13:02 -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 S1753443AbeBBRMJ (ORCPT + 99 others); Fri, 2 Feb 2018 12:12:09 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36740 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbeBBRGR (ORCPT ); Fri, 2 Feb 2018 12:06:17 -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 02887E8D; Fri, 2 Feb 2018 17:06:16 +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.9 77/86] USB: serial: io_edgeport: fix possible sleep-in-atomic Date: Fri, 2 Feb 2018 17:58:37 +0100 Message-Id: <20180202140829.747307495@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140822.679101338@linuxfoundation.org> References: <20180202140822.679101338@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.9-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 @@ -2215,7 +2215,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;