Received: by 10.223.185.116 with SMTP id b49csp3186441wrg; Mon, 5 Mar 2018 16:04:25 -0800 (PST) X-Google-Smtp-Source: AG47ELtTCcDkRRDTQn+LR5bu9cEiJNMlJOMjfi2FCjFtrVBl56e9LFyH5xGVb+oN2KDN5BISK9ru X-Received: by 2002:a17:902:5716:: with SMTP id k22-v6mr15001905pli.229.1520294665819; Mon, 05 Mar 2018 16:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520294665; cv=none; d=google.com; s=arc-20160816; b=ALJznKOqKdA1czgsy69p0VQUgebd7g4nA0kPwRSfCzqMngoAdkf3Hgrlcus2uBsaw4 1nLKqU4IH3z7hMhZ3E5dghq0Jv9WwsYWcEt33Eb/+TD4IaHdl3eKFY1zj9v0dpwA52Fd iQ6NEZFPu2meMHtSpVTMG1Melu2mB7oLvvu5OXs26LBOlP1jDEa0uVvCZQPs2Pvu0MJ3 oZciCKA1PFx+ilKvRJAsxm69Jv0vhdEgTyLMcuV8J5NymVuf6zdWp7gOiIxdskIgfr58 rz/hdFa8RycYUFjvXlBW0X6UYvcbQAW6HYmz19MgXCHNGg+tKNa6YyF6qxjcuCoNSgdF i4xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=RAVmzsuP01+rq9AULZR7X6GmxX1WKM60azbjtb+aKYg=; b=kaWQOpWXdECIk2qgrnPM8SRKr/tTDjVb//qlUf0D4ohehWNuVV3yc/36yDzWrvV48n QSaFzt9Y0TUHnY7NwEIq9ZDHuxb6ugjDZkCfVdQNQk1Ipw3ewgUD0E2qoaopZLmo0Y/0 F3OzdlGo0KFw41SZD017WS1hsqrQ9qU9+vf0y2aWYw8cWz5umk9YRjO2Sy2W4cpHg2wr PBNcGsF3iq7OG945s5dcz5uW/JE3E5BEWG/WWSW3ZoY/MA9sSem7v7HPW0okgPRQuCB6 5JVKmYb1as2+KGkuz04+ZEWi2yioSys94AhqTbsrbYfqL6bDKJ2oJs9ZOorf/49aB5U8 rmYg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y190si9039471pgd.177.2018.03.05.16.04.11; Mon, 05 Mar 2018 16:04:25 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932751AbeCFADR (ORCPT + 99 others); Mon, 5 Mar 2018 19:03:17 -0500 Received: from osg.samsung.com ([64.30.133.232]:54116 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932243AbeCFADQ (ORCPT ); Mon, 5 Mar 2018 19:03:16 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id A675C3943E; Mon, 5 Mar 2018 16:03:15 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QygxSZHUyzSe; Mon, 5 Mar 2018 16:03:14 -0800 (PST) Received: from [192.168.1.87] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) by osg.samsung.com (Postfix) with ESMTPSA id 03D9639434; Mon, 5 Mar 2018 16:03:13 -0800 (PST) Subject: Re: [PATH 0/4] usbip: make vhci_hcd.* objects independent of vhci_hcd.0 To: =?UTF-8?Q?Salvador_Fandi=c3=b1o?= , shuah@kernel.org, Salvador Fandino , linux-usb@vger.kernel.org Cc: gregkh@linuxfoundation.org, valentina.manea.m@gmail.com, linux-kernel@vger.kernel.org, Shuah Khan References: <20180130083630.26501-1-salva@qindel.com> <391a54d5-73ac-3bd5-49ca-114639ea69fd@kernel.org> <60da1c91-d6bf-1922-44c5-3b8010129cc4@qindel.com> From: Shuah Khan Message-ID: <6f8af831-e7f8-787b-b1f9-465062aa7e8c@osg.samsung.com> Date: Mon, 5 Mar 2018 17:03:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <60da1c91-d6bf-1922-44c5-3b8010129cc4@qindel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/05/2018 02:00 AM, Salvador Fandiño wrote: > On 02/21/2018 01:35 AM, Shuah Khan wrote: >> Hi Salvador, >> >> On 01/30/2018 01:36 AM, Salvador Fandino wrote: >>> Let me start by explaining the problem that have motivated me to write >>> this patches: >>> >>> I work on the QVD, a virtual desktop platform for Linux. This software >>> runs Linux desktops (i.e. XFCE, KDE) and their applications inside LXC >>> containers, and makes then available through the network to remote >>> users. >>> >>> Supporting USB devices is a common feature customers have been >>> requesting us for a long time (in order to use, for instance, remote >>> signature pads, bar-code scanners, fingerprint readers, etc.). So, we >>> have been working on that feature using the USB/IP layer on the >>> kernel. >>> >>> Connecting and disconnecting devices and transferring data works >>> seamless for the devices listed above. But we also want to make the >>> usbip operations private to the container where they are run.  For >>> instance, it is unacceptable for our product, that one user could list >>> the devices connected by other users or access them. >>> >>> We can control how can access every device using cgroups once those >>> are attached, but the usbip layer is not providing any mechanism for >>> controlling who can attach, detach or list the devices. In this use-case: - does a container act as usbip client and attach devices from their host? - do containers attach remote devices from other systems? Is the core of the problem really that any remote system can import without a provision for being able to restrict export to a set of remote machines? If so, this is a generic problem even without containers and I would like to solve this with a generic solution that works in all cases, not just for containers. The approach in this patch series appears to solve the problem just for containers. >> >> Did you explore a solution to add a mechanism for access control to >> usbip? > > Could you elaborate on that? > > For "usbip", do you mean the user space tools? > If that is the case, I don't think it would be enough. > My aim is to limit vhci usage from containers and I have no control about what runs inside the containers. So, a mangled usbip tool-set could > > be used by a malicious user to circumvent any access control set there.> I mean the driver. There might be changes necessary in the user-space as well depending on how the access controls are implemented. I am not proposing implementing access controls in the user-space. > IMO, there is no other choice but to control access to VHCI at the kernel level. > Probably. Please give as many details as possible on your environment for me to make a call on if this problem can be solved in a different way. thanks, -- Shuah