Received: by 10.192.165.148 with SMTP id m20csp4183522imm; Mon, 30 Apr 2018 13:23:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqheu7yq150k95L0kkIMGL364dWQKVe7pHsRxLpxnWf/hRCnmz4WMye89JbUHjKOf8nvBJ5 X-Received: by 2002:a63:c8:: with SMTP id 191-v6mr11026315pga.33.1525119790981; Mon, 30 Apr 2018 13:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119790; cv=none; d=google.com; s=arc-20160816; b=TdbJJgmjmnIl2wlSaVVGhZbKeRJKZQRePfSO04gc8mQIHnV962o//uaBl51ULix/WV T7zFHbopCOCrodfO2XqfkOpIGxPl6mJA9NL+KCvqgX/oLAkIraw4vvt7pJOKD2C663Xm uERl5HMxOSqzNHvQEkmvNyKsLmDNKkz64WiNnvwsusMBah/gThdKFmp8kShy8/6Fc3ts 7LZD0foo8a+v/TgFFYuttoUtOOXnwxtPHY+11XAMu7jDwQ9bkVad45FCH0007ePVeQP4 v6iTlawqXm7zOIcA5RraV+qYSuCmHD5wVwlD1iUT49xnyYqWZMMueeL+otWqKyJ8Mxlz 0HMw== 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=kFMEXNfbNbB0rXgUeTnk9/wzyPucnzsWSWonbPxu0CQ=; b=u/VxAiqpIlowOZDcLpLPArIRopWFYap2w1hIlbvyhLEsbM/Q5uFud7qObb6oWPlr/q 8VcLsTt2UVsUfEM5UyOwLplOge65oXGmrtfn2RBOOBo6sfncYoT7WqNTJa3qhPoo9rTt vky2CI9QAS58bS5XNlh8j8FrwUCP2VPLb4NKeV0TNuHY1bI+kk3D4O15LaooCpl+PpSh 8A1qadBBgKWY1Suury8IfGSIsKnkpUDKANIgTvPGLJ7lycaPXfnWIZnQ5ucCMIr5pYyf i+DLD93eOjdM6FxB+6yDCVYYNxyNub0TnAr1hxZ9nI8ubayivcHR6noF828pvZHEqLm7 jXeQ== 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 h187-v6si6721332pgc.100.2018.04.30.13.22.56; Mon, 30 Apr 2018 13:23:10 -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 S1755883AbeD3UWp (ORCPT + 99 others); Mon, 30 Apr 2018 16:22:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:60522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755728AbeD3T0i (ORCPT ); Mon, 30 Apr 2018 15:26:38 -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 AC57B22DCB; Mon, 30 Apr 2018 19:26:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC57B22DCB 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.9 09/61] usbip: usbip_host: fix to hold parent lock for device_attach() calls Date: Mon, 30 Apr 2018 12:24:12 -0700 Message-Id: <20180430183952.083852371@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430183951.312721450@linuxfoundation.org> References: <20180430183951.312721450@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.9-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;