Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6011332ybc; Wed, 27 Nov 2019 13:21:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwv0PEOyGeMZGeHQolOY1rDGsHSGkeWMpIY+SJD+/+FEnwNadecqyBADtU7GYVJVhw5hOWh X-Received: by 2002:a17:906:f29a:: with SMTP id gu26mr6544387ejb.236.1574889694721; Wed, 27 Nov 2019 13:21:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574889694; cv=none; d=google.com; s=arc-20160816; b=L3WkB7sVcoDZ7iCk/o9GSbDPLB4DRuOD8oQyQGwlcNg1Vq8YIY1aJ+ZI+Hbmf/Rx7p Eg4pJ/nQ4z8Y3DMr/LZ3vse4hRVfGiL7VBUXP158C3eNpMxYcWa4xsMQROJhQby4TXgm ueLctin6FJLbda9nWthfQM0sg7Rlv+rLbmIPIX1sA4r3M2OWS/MQI57hnoMyye8LeQk+ cfNwN2nWI/Vip1F1jaFX78Mk60F8ESeWND0+OWM86+TwKKDtYoVwRbYc0y3JoWxLqBoq CVsi/Uuk8WA6t9ZsoE8deFnNypVLmVxWIVLyU42cq1BLfnKL09Lhl+dNny/z9UZoqTZp aNgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bsLzH3jvl0TnJwG8vyIGnnp3rEt1/RJR4HTFvoJTkBw=; b=TYQpxBd556545z3tankUd93XAqwRn14A9G2dkzEHcbtJN1tIE6ccyTJuFzZsknNO/g aDQqfYC6ZF+DtBr90/gwTWwvtHlHFe8mbdpuL8x4TaLGMvObFenluTUV5I1yka4XU8lo hVccpAGPE+TfWhizrNrm6ywi72hBhROcglHnG/oN/A/K3xqx99LnwDxrmca+IbHacioR W4pqafbR8J/ooniMeVTNvjlClEaSziv7EMOUe989QqYgT8xr81FurP4XbBACyWSyQxn7 2DS9nRHGkuQdKQjODq87djpzjeHM4sAiz5HIwvVz82fojfMfa+EBRBFvGZ9e6RwzKJVW HLlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ymgCPq4+; 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 ay20si1610119edb.62.2019.11.27.13.21.11; Wed, 27 Nov 2019 13:21:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ymgCPq4+; 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 S1733114AbfK0VLD (ORCPT + 99 others); Wed, 27 Nov 2019 16:11:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:38978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730786AbfK0VLB (ORCPT ); Wed, 27 Nov 2019 16:11:01 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C33F21774; Wed, 27 Nov 2019 21:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574889061; bh=pf8vHl++j1XR6IXLl1oZf1CJuHieiqhwzC6AzRFcam0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ymgCPq4+fseDewG6JTjUmAiWs+WNCfS49KuYmq4vfpmZJFMFnbbjbUCJzzPr/+OJe LfrVM5f8G9ajPZ76xtT0xKxdVvinTpiySCOTi8fI8VYeMmychje5FUnKKTxnC9WQA8 5chvgRN8EX8ey3LGGhqIuQBkpMQQ257frdS3djw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , "David S. Miller" , syzbot+711468aa5c3a1eabf863@syzkaller.appspotmail.com Subject: [PATCH 5.3 68/95] nfc: port100: handle command failure cleanly Date: Wed, 27 Nov 2019 21:32:25 +0100 Message-Id: <20191127202932.374553291@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127202845.651587549@linuxfoundation.org> References: <20191127202845.651587549@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Neukum commit 5f9f0b11f0816b35867f2cf71e54d95f53f03902 upstream. If starting the transfer of a command suceeds but the transfer for the reply fails, it is not enough to initiate killing the transfer for the command may still be running. You need to wait for the killing to finish before you can reuse URB and buffer. Reported-and-tested-by: syzbot+711468aa5c3a1eabf863@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/nfc/port100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nfc/port100.c +++ b/drivers/nfc/port100.c @@ -783,7 +783,7 @@ static int port100_send_frame_async(stru rc = port100_submit_urb_for_ack(dev, GFP_KERNEL); if (rc) - usb_unlink_urb(dev->out_urb); + usb_kill_urb(dev->out_urb); exit: mutex_unlock(&dev->out_urb_lock);