Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp30975imm; Fri, 21 Sep 2018 17:27:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV61X+YUyQAkwblbATIcbHnLI8zmpHjlfDEs8gslkar/JuhdoKJ0tcHRy1+lL/h4AJqovlUBa X-Received: by 2002:a63:fe49:: with SMTP id x9-v6mr143219pgj.152.1537576064010; Fri, 21 Sep 2018 17:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537576063; cv=none; d=google.com; s=arc-20160816; b=aAHmcWcMNsOiHc2xqt48aMvnguDTg8X83WpxCqLhTh0/Mv5YmoCbdvNRSf4yZNq/Z3 zB9/xtTeqlm23l0z94/HfvJcaKwc0yBNFf5mJKPloMiytlvVL4pxJbovnmtA7Pd1oKkv BVfOPOaT0dnB6/i67SWR+39xwqqyknXQIPORGP686cdGUhh7xtSZEAkt+DSDw3dzuOSs u+dKOYIk5VaaX/BsMiMbwcp1Lhv9PLICGcIM0YEFk9O205QgUY+YFMGDi97FtndVb4a6 ohrAdVkvzpVOclJkI+g3+o9kZvfFEVGfayZSb21Q5dLU70PzrxUbp5NG/rFNI31Wwd9K QjmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=GuCNXk5/xU5lOZKjOcCQya0rWWOuJYfCaLQMWV2Ztsk=; b=DsSg3NNMG6ACfMyF2i89+HKG2PmmqTK48NuwZJ4bqw5qYQz8eAgwwq5k92gWrZ07cx QUL1tBqgRVZal3O4S2Uu57Zn61pGB8lhIBIh0M+WcZSPr/BPjl48U1xIXGeuRTgWOB2M xpfpeuih/zPkgOVPQEvhuF/Vom57BdpIt3u/yvhy5Mpo/x3SuYbapmyo1L1GUPb9u10X 7z1zo/SQ/R/rFi25+w754sed25UjdadReHQt1BUo/7tK3xRgbukoptDmU5HnKEOLc0Ry /eRSth/r3orPot7Fy5XdbVbkMVc9WTOhsfF/GrQ9BQ9koQp0Uan4qrTmEbNWWR7pYqNs 2v1w== 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 a61-v6si29264354plc.239.2018.09.21.17.27.28; Fri, 21 Sep 2018 17:27:43 -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 S2391950AbeIVGRn (ORCPT + 99 others); Sat, 22 Sep 2018 02:17:43 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:44087 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391852AbeIVGKm (ORCPT ); Sat, 22 Sep 2018 02:10:42 -0400 Received: from [2a02:8011:400e:2:cbab:f00:c93f:614] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1g3Vds-0008BR-Cb; Sat, 22 Sep 2018 01:19:24 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1g3Vdn-0000q7-88; Sat, 22 Sep 2018 01:19:19 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Greg Kroah-Hartman" , "Shuah Khan" Date: Sat, 22 Sep 2018 01:15:42 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 06/63] usbip: usbip_host: fix to hold parent lock for device_attach() calls In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:cbab:f00:c93f:614 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.58-rc1 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 Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings --- drivers/staging/usbip/stub_main.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/staging/usbip/stub_main.c +++ b/drivers/staging/usbip/stub_main.c @@ -205,7 +205,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;