Received: by 10.192.165.148 with SMTP id m20csp4180075imm; Mon, 30 Apr 2018 13:18:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoEDD3WI3YfjW6ndIpD1vDk18JW3hVMnQy5E1NLPmD2C6w/fQLzc+rOgNKbUlP9ONOdsN7m X-Received: by 2002:a17:902:380c:: with SMTP id l12-v6mr1887075plc.19.1525119519533; Mon, 30 Apr 2018 13:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119519; cv=none; d=google.com; s=arc-20160816; b=0B7E0XdtoRHaHI1DxCHM007kn7dgwnX/Jv+4DbNiy00h2BnUDXuhVy9axyyOdtx0ss mSCX0bYJtMTopLvVe9CJYPD4DWbSiAP7x81mTaByf3RE+KRok/lomw7kR88eGTKvYEZp dMrfFpX7DL0vZfbO3yuxVV7iHSd4J8fAHwlVMiUoOw5ZHXXmr9kjnwRvtPGNKrMij3wF WXuvaWE9B7ulz9zhz+dCMDU18WNiQXi57tZMamyXeCMvxuCVSHbLIP87ZBfX84VzFyZY TRU8Kaj/Dztwey0mXHME89KMtd/YSOKpU32ruTJM+eu1czw9b4SK0XCaDpfn5KXdWMQs WrtA== 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=lPmJsv3H6V7OawAO64KH1XmvwOtY2gKWBWHM+ZRSMNk=; b=aFlIPe1a9uDVztktfBh2rSs5Npyo+fxSuhn/jkIYEFLruy+uVGcocqhkKAJ4smf0Hq M+EgSsyuVYsa7O+2Xzi6LjkUe9UHWck2Ex+cD2ljSyf16qI4JlEOSc7LaKarnh82uXW/ UQAbut5FDPV3v56XyuC9KeXo8oaR7Gt1WbXyNNE3wesv/VgHfgh+8EtTTkksgLQ0SxZV kJwRaX3FACSIQxOWVBoq4NcI24zTNwnuxth1628eTsWM6Doft+zmUKmToUibZx8Qj+Dl RNXs+wIQtmI8Eyd+rkuK+17QQhT10bpz5xqVV2OmKrBXvEOr6oPtulBo2Fm0mAu3vPWr BEJw== 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 v8-v6si8037005plo.306.2018.04.30.13.18.25; Mon, 30 Apr 2018 13:18:39 -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 S1755929AbeD3USR (ORCPT + 99 others); Mon, 30 Apr 2018 16:18:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:32908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755290AbeD3T0z (ORCPT ); Mon, 30 Apr 2018 15:26:55 -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 0EA8322DC1; Mon, 30 Apr 2018 19:26:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EA8322DC1 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.14 10/91] usbip: usbip_host: fix to hold parent lock for device_attach() calls Date: Mon, 30 Apr 2018 12:23:52 -0700 Message-Id: <20180430184004.766740270@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184004.216234025@linuxfoundation.org> References: <20180430184004.216234025@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.14-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 @@ -200,7 +200,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;