Received: by 10.192.165.148 with SMTP id m20csp4195847imm; Mon, 30 Apr 2018 13:38:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrAblqO60KGv7i6VJaAH2rhwlcbU3CWK2LuFbL5pdLECAQSzzBUFGW74VicrKjuVFmw+FTd X-Received: by 2002:a17:902:6505:: with SMTP id b5-v6mr13667673plk.147.1525120684462; Mon, 30 Apr 2018 13:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525120684; cv=none; d=google.com; s=arc-20160816; b=HdWwH2OFAmCXO+fPcc+QVUAie8mBUE/CGCtbL8iv5tZpS1FUGDizzPyMGUo7k9uCJt KgArVmbb+LEAyUssbMiIPJ/YnI4MDxwqZShTPDq5uD/OlbZcD5M2S7oPA1hfzatqgIv+ Mq74a2EHcussNxfLYsje+hA6h2VhErFszR2N+mjillU6pfIs2nHTRitoSkMCv7cbnKad MsGwunE2Q2pa35qk2fdur31s8KUtWr0CkqIsVWmUov5fBM1SIrWxcIXdJtQbmJQF3DSm zzezAUr/r/B0xox/GSAIyybkLXOh3RU6zS1SS7rU5IJD3+kOLXSYQ5gCns3e6AX5lipk NdHw== 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=WXDj5i0tUWBPa63GLfuevdV2Cdn4xFYKto+kt2AepHs=; b=DKXrRoblV+ga/Xj9JTFmWANgJuzzAw2DHGZ+vyw6teROacqHDcfEkF5NhniwnuSKHa 63FHRs7Mw1Jmp3XjtdAiSoLqYmOx2dOSC6Ws/01e+cXTeWHKe8olrOwnvJ03ZcLgxYVb PIwq4HdbKo1YgaJDoFfUN3ZBb4N1UrCP01X7haaqjP8UuHznxhu7Vjl8hGAxN8A3x1cP 4PXFrwHTugwZMMvXc8/4NCvA140eqMs47dhSDWxVA/sxFF2Z1M5Qa379rxt5oOomj59i 1IkyxyQ2JwbHfJv7RigbsDWS73710SwYhiraru79Uu/frz8SjYeuoaWhzPTBwP8uN8WL 7u8Q== 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 n13si7807625pfg.227.2018.04.30.13.37.50; Mon, 30 Apr 2018 13:38:04 -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 S1755440AbeD3TZ4 (ORCPT + 99 others); Mon, 30 Apr 2018 15:25:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:58726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755391AbeD3TZv (ORCPT ); Mon, 30 Apr 2018 15:25:51 -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 7562422DAC; Mon, 30 Apr 2018 19:25:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7562422DAC 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.4 05/44] usbip: usbip_host: fix to hold parent lock for device_attach() calls Date: Mon, 30 Apr 2018 12:24:16 -0700 Message-Id: <20180430190946.548163410@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430190946.093694747@linuxfoundation.org> References: <20180430190946.093694747@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.4-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 @@ -201,7 +201,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;