Received: by 10.192.165.148 with SMTP id m20csp4160066imm; Mon, 30 Apr 2018 12:55:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+xa0wT1cegEOPw5s87nfo9otLh2ZN/Os+3icfUprAsdtSvQ3FOM06Hw1dDqAq0zNzsieH X-Received: by 10.98.29.82 with SMTP id d79mr13161565pfd.230.1525118153066; Mon, 30 Apr 2018 12:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525118153; cv=none; d=google.com; s=arc-20160816; b=hsrKzgmhP0an0yddq/GRPyslrjpeYJBdx+OJn+XMjNMvgM6031Y8X7qRB3UHxutJjH lWf7lUqNKmrTJqSTWchnhx/sDWJvEM87cSBP6+JjTQKh+rcH51mkjXDq7bt2XmNPjcLA 9+UcIHomaOl6tAPTA90ONNNFWDyqHykPIE0NXJZS4c3mFUtg77b2AQ+gMywTs1CtjLB6 NWviO/YAqwH9we9RoZpTALdCgzlvf44B0qMoRRTEUH5KXXNhqMSfh+jNq57aj7Um59SN /ZnYwBs8uQPMPIUNmJMoPw0Xgr5nNV5bO09Xgo01/Rw4XOAZRlvTYbChHskWZnv0sGcn RbwQ== 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:dmarc-filter :arc-authentication-results; bh=cGqPPKhBKVK7NSVswG+nsFbL21i9UOc3L5SqAdxv/Bs=; b=NhGeQT38eEPjqtkDStxr0Dye4SLGAIoQ0Bb+YTFkXdrgtO0CXEYEnQ4NQKyiavlWId e9Ax9vVOhA/Bcd7Djfnu2GyGZwar3n1LmA2bJvy2KmAScHz7jIedvDHqmv+mUqB8TQRG PsxhZwHCy7Ah/8nzmVb9p/UiMGyueYkd/XKGKUmnhqSs7WNtdLg6PWCxEe0A6L/Xlq2z ah59Vfpjjq/qTYPxG/FPQo8WwNxt1AvRnJwIK2ZDqjgrqO71iQnQaYFR3hlyuYmKg9vS hWiU931QUNnLhLfPir0ThosaUaEIvPLkhnJVPkrhaPArr1N7GVvZejPtEervh6eokS1Z DdNw== 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 i14-v6si2227567pgp.558.2018.04.30.12.55.38; Mon, 30 Apr 2018 12:55:53 -0700 (PDT) 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 S1756153AbeD3Tzc (ORCPT + 99 others); Mon, 30 Apr 2018 15:55:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:34980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756095AbeD3T1x (ORCPT ); Mon, 30 Apr 2018 15:27:53 -0400 Received: from localhost (unknown [104.132.1.102]) (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 E344D22E01; Mon, 30 Apr 2018 19:27:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E344D22E01 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shuah Khan Subject: [PATCH 4.16 010/113] usbip: usbip_host: fix to hold parent lock for device_attach() calls Date: Mon, 30 Apr 2018 12:23:41 -0700 Message-Id: <20180430184015.503533943@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shuah Khan commit 4bfb141bc01312a817d36627cc47c93f801c216d upstream. usbip_host calls device_attach() without holding dev->parent lock. Fix it. Signed-off-by: Shuah Khan Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/stub_main.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/usb/usbip/stub_main.c +++ b/drivers/usb/usbip/stub_main.c @@ -186,7 +186,12 @@ static ssize_t rebind_store(struct devic if (!bid) return -ENODEV; + /* device_attach() callers should hold parent lock for USB */ + if (bid->udev->dev.parent) + device_lock(bid->udev->dev.parent); ret = device_attach(&bid->udev->dev); + if (bid->udev->dev.parent) + device_unlock(bid->udev->dev.parent); if (ret < 0) { dev_err(&bid->udev->dev, "rebind failed\n"); return ret;