Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4829963ybl; Wed, 22 Jan 2020 05:31:41 -0800 (PST) X-Google-Smtp-Source: APXvYqziWlJDxvixf/rmUr7jrsjrTPyblZLKAFGnG6R8TL6SCT5JYxzmbPj7kj4QpfnCMxHFweOo X-Received: by 2002:a9d:674f:: with SMTP id w15mr7519166otm.243.1579699901708; Wed, 22 Jan 2020 05:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699901; cv=none; d=google.com; s=arc-20160816; b=iKZ1rb1ESoQfGV/HbuewC2eDkdY+vs0NK18r4LxcKULnHpg6gKfz/2N/HobxG3KLcL dig8DwQD7rScBOGw3Ds/prWDRtkne9Lj/q/91fjeW4CfcMtNYQU6oPVrEkn7NZVH4B/w R/SBo3MQcbAwceP3U7EfGdOd5FdNY8uETIGI/WO7TjypNGUBMHDdEHJFOwCrCKgQwFrN PXbHcdH1dPWohwopUa15x4j6TRyg+e+j9jz6oEPMtsBVPZKEyFMuwAH2NeXDWdmNZ0Yv eid8CeeZD8uyEvkuYaQEhJGVNzranS3ny4vK/egEW2VHd+3DRoGs4wFz7svLevvEBC4f b7/w== 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=DNZsrcE/d/GAq03MaJ4BgHXANrfGtt0PaNeTUExVeC4=; b=iN+QkuNDxyqHbIdXsmFi27ipLSrBjwCZqn5Uxf/h1ODNvKPB1JsYGxMJMRE0/ZQJjM 7TK4jvKNILDktAn360oFXoI/Wvfa1ZcCkuSSCiSoNS2QIg9rYGBiKJfcaeuik5wEPfFS fSDQku7jbhp2mfLFQudqnLBdVepgyCtnTl11fUKPJeU57MKoQ6++mjH5Gs0r3PjlM/E+ t5rT23rBrtUEc7I1HpskhOR5po+LHPCcrYPOhI9x/d8nD59NeGOeJfNAK3KBZ0+3AHxG PfkWQisBsGy6ykhLYl0jHg9HygaGfArtv2k/Cf3bHmku7krYehn5uzOtA0iKztbiW13j Dq2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uOXH29gb; 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 l14si20902765oic.222.2020.01.22.05.31.19; Wed, 22 Jan 2020 05:31: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; dkim=pass header.i=@kernel.org header.s=default header.b=uOXH29gb; 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 S1729950AbgAVNXW (ORCPT + 99 others); Wed, 22 Jan 2020 08:23:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:41464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729100AbgAVNXT (ORCPT ); Wed, 22 Jan 2020 08:23:19 -0500 Received: from localhost (unknown [84.241.205.26]) (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 0FFEE205F4; Wed, 22 Jan 2020 13:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699398; bh=OD7n9DR/CXM0JoRPTTOVsnhzA1oG56OYYXNu0yJCmnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOXH29gbWDZFtCHHXAkNhCWgG7JspqeMM5cMrEugaimCvA4oZ/JIV2jQDxExpPnaV caNPTCaNr79z15GxrGHsiS90U3CXuziww7LXD0KQCMTGkXxLpe6cRkLiuFMjdXRJU2 7cEAUqX3AK+xgaq29eNj0sX2XFtx1NW+VQOJSvwY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Jakub Kicinski Subject: [PATCH 5.4 132/222] NFC: pn533: fix bulk-message timeout Date: Wed, 22 Jan 2020 10:28:38 +0100 Message-Id: <20200122092843.197411658@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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: Johan Hovold commit a112adafcb47760feff959ee1ecd10b74d2c5467 upstream. The driver was doing a synchronous uninterruptible bulk-transfer without using a timeout. This could lead to the driver hanging on probe due to a malfunctioning (or malicious) device until the device is physically disconnected. While sleeping in probe the driver prevents other devices connected to the same hub from being added to (or removed from) the bus. An arbitrary limit of five seconds should be more than enough. Fixes: dbafc28955fa ("NFC: pn533: don't send USB data off of the stack") Signed-off-by: Johan Hovold Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/nfc/pn533/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nfc/pn533/usb.c +++ b/drivers/nfc/pn533/usb.c @@ -391,7 +391,7 @@ static int pn533_acr122_poweron_rdr(stru cmd, sizeof(cmd), false); rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd), - &transferred, 0); + &transferred, 5000); kfree(buffer); if (rc || (transferred != sizeof(cmd))) { nfc_err(&phy->udev->dev,