Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2051929imm; Thu, 24 May 2018 05:07:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZovjvMs4VSCOF54+wA249bMkHukU+EY2GdcueDobQ0SDKBRTz90Z/gOgJwt15REi9v+Cfi1 X-Received: by 2002:a63:b34e:: with SMTP id x14-v6mr5706488pgt.70.1527163651674; Thu, 24 May 2018 05:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527163651; cv=none; d=google.com; s=arc-20160816; b=gv1JaD8wGcyk7Ft17OamTo9YypTS/Ps91vFEWqsneTEjMjCX1JkGmViX3M+DRQWDPi 4s7B2LTY962q5dGkeCy0YSHKoiygNvepn2UgNPtGxEoljtunGA1i6aP/waN6ITWbk9+7 wmyEuI7url/GYxP5cXfcKIjiPJKaMUKdCNPTJoeVG1Ou62I8oqQvDq1XiCKA3l47kSQn jOwMohaRNTbG3fq1gHdoY5qcZctUKC+jQm2FtUagGF6wcq8uhtjrQUXKuFf5abMrECyF p8hy+jZdeZO/57Eu9FOI0a1qMf4rLFIVdHn/0kT/t47swSxZd5la2nN5MgjzuNWACinu oQFg== 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:dkim-signature :arc-authentication-results; bh=QrcnSyySDUDazMUtAyGWtxXeVnJX8sF/bGy/LbFpfA8=; b=J4lCrCxIdAu57hhs1w5LPF0sW0g+FvWwyZwomRcyIbvBXR0FRWKOzDf/YyF2O7u56P Yk1DibxTO5IU+DEQhs+sJpanVUvDWFjLX4k95k8irRd0ACjDXpih+FrVweZl55uMAFLg zq0sqSTNfuGBpSFsbjm0Rub2txOLqZ1/zjmhL8WJ0WQDaQhiLiKxFJRKOJdzBn8wQNBF Qd7/+fSzE+Dr+XJMJ2jbA0+zlxSmkCMMWl3o8fjpgZcBFjKpiix70IBZu46dC8qBBSIp UeZGEyd9grhcFoRVk+v26xZM+u+Q4vAgiDg3lXvwlprL4xSlaQR3gvOxP7f1wcPtoaJu GziA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SFezC+Pv; 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 d4-v6si20445809plr.373.2018.05.24.05.07.16; Thu, 24 May 2018 05:07:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SFezC+Pv; 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 S969629AbeEXMGS (ORCPT + 99 others); Thu, 24 May 2018 08:06:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:55450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966534AbeEXJoF (ORCPT ); Thu, 24 May 2018 05:44:05 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 BCCF8208AF; Thu, 24 May 2018 09:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155044; bh=W1C9JPI0bcyfZp+tKMpfrH6Oq6xJG6aaqx6YydhoQ/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFezC+PvD3Q6MXyRCpYshUGwB/GeZIzcyaMxCwA53vFx5Od58Sl6eE+kHkVNZH7hh pjbr49ylgE0GbbgfECa9tl0aGz9akuDPZAw5yZAsLsDPkUIlP8kUOq+T1ExtaEVIk0 WBADUT1ONTUbiqi1JACxqJw6boy2pFqrYaZZqETg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Shuah Khan (Samsung OSG)" Subject: [PATCH 4.4 34/92] usbip: usbip_host: delete device from busid_table after rebind Date: Thu, 24 May 2018 11:38:11 +0200 Message-Id: <20180524093202.196011221@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@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 (Samsung OSG) commit 1e180f167d4e413afccbbb4a421b48b2de832549 upstream. Device is left in the busid_table after unbind and rebind. Rebind initiates usb bus scan and the original driver claims the device. After rescan the device should be deleted from the busid_table as it no longer belongs to usbip_host. Fix it to delete the device after device_attach() succeeds. Signed-off-by: Shuah Khan (Samsung OSG) Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/stub_main.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/usb/usbip/stub_main.c +++ b/drivers/usb/usbip/stub_main.c @@ -201,6 +201,9 @@ static ssize_t rebind_store(struct devic if (!bid) return -ENODEV; + /* mark the device for deletion so probe ignores it during rescan */ + bid->status = STUB_BUSID_OTHER; + /* device_attach() callers should hold parent lock for USB */ if (bid->udev->dev.parent) device_lock(bid->udev->dev.parent); @@ -212,6 +215,9 @@ static ssize_t rebind_store(struct devic return ret; } + /* delete device from busid_table */ + del_match_busid((char *) buf); + return count; }