Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp178608lqs; Mon, 4 Mar 2024 20:57:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUd3A9DsZxnGb4T86G4XOW4q9oFAwtgCwcmNIyeHkmbohfmKrQSN8fBfsYYFA+/5cV8qc3x9PjB5P9ZdosPqcDPwJV43YwQVvLn75mcqQ== X-Google-Smtp-Source: AGHT+IFWxwSS9B7mBpCfnaVPNu7S/FROGIFdkaq6+7z0cBdBHQA4sNTTt9CB+S2q64MsJr4g8KD7 X-Received: by 2002:a05:6a20:8f0c:b0:1a1:4cd2:4398 with SMTP id b12-20020a056a208f0c00b001a14cd24398mr809289pzk.8.1709614654283; Mon, 04 Mar 2024 20:57:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709614654; cv=pass; d=google.com; s=arc-20160816; b=vSiA/hwGlAr0q4Fr8lFTelaKHSxMXwXxGwuQkY0mGGpfCohtpjqaTUYgmgl8B5ejX3 HhEfI3iBIdegFTau8v64DgjfCDdz78gnksLWlNCjCRvJ2d5XPZxRmBXlRjWC3orWlRFH yUVZTXwJwXBe1XpWyozfJgso1DOkEofGwlLqiVSSZZVLssu+ELHdhyp4VXmbWN12OSE+ TM8UGV/wpNNNCJF4yhyR0yLxmFqJzoPKG93xb1tiHIM6zywWh1A4f0+oKtmdP+TI7z1Z 6RrdKnF4UGFWPKdvGPbiXzq5+b6NSG567HQOwDTIy/uCMlT+RFWAYLZNJJkflODh99t5 9OGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=TG8pyywQ8nLMoE+dLkiL//MwC3A6zrbPd2r/WzUzL+k=; fh=4aCTnjt0lHRyvk8WaQWBzD1fq3ksKAGkgbT6A1PbfT4=; b=x77NAD43Fgv6/8n70BYt1gfZeCQjnsX58Xsp1G/nmo7un8NiMgVx0PyIq8RaSHL65z vaINi/gRqtgRH0bLquAPmz5ANFwhyOSRv2EU7SiwwW0HfNx7mNWz0qVXVFS1Z1OBFXiF uLRngRp5FCmw0BSIPIb51cGN4vPGwIIv7VR9xnbjDvw8M8tmyBI/xy2H/EGApkUmS0R+ NleXh0T6AWngbOuGC+WFQEgLF3eo94YTPli4h1aZZf1meJ5NXWABscg23674CcmikACl +Bt6lUk8YdRM53D4qdsQppStm6lYgucmfTnMSdkC41BGeTyFZLAssdljdcyO61h/5yL2 tWsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b="YRRi/b/F"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jc+dfT6T; arc=pass (i=1 dkim=pass dkdomain=invisiblethingslab.com dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-91386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91386-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ft18-20020a17090b0f9200b0029a3c01e4a1si11454517pjb.139.2024.03.04.20.57.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 20:57:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b="YRRi/b/F"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jc+dfT6T; arc=pass (i=1 dkim=pass dkdomain=invisiblethingslab.com dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-91386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91386-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C8D9E285E19 for ; Mon, 4 Mar 2024 22:58:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEE017C0B8; Mon, 4 Mar 2024 22:58:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b="YRRi/b/F"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="jc+dfT6T" Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFFA37C088; Mon, 4 Mar 2024 22:58:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.26 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709593092; cv=none; b=sGsnysHbRzNQjI2rNUi3Jx3v6xIFYU2iBrfaoyiJ9cqLtjOiq5y6zAO/mUdQkLnEWvnTgsYEzM9xVnpxQ5fH1t7W+ZJV1tto7JLHu8/8W6vS7pWUH2qwH33AZY3CeIDZkPJbpBiGjEXt5uVmL+TlOBgWH2fRjaf7ueygTHYbI08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709593092; c=relaxed/simple; bh=KOD4C83w2+dww3yOnJs5mJRxzc8AwkYUy6x4gdoxQZg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wz5vMQUCf7t0sVtdCZ44bM+2weiFyYTK6unzKYCzCf4CDNlZFvd6r9aRHff74jY3K7ENGjU/3trArpAg6e0wzwFa6ZJOvvb6EzeCF26+qTUEOxIfvcUUqZlTOGEeblp2lZGB98BHcLBh8eygNvhe2HfHPFPPcTvutkdAjPn0tWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com; spf=none smtp.mailfrom=invisiblethingslab.com; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b=YRRi/b/F; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=jc+dfT6T; arc=none smtp.client-ip=66.111.4.26 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=invisiblethingslab.com Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C2EEC5C007F; Mon, 4 Mar 2024 17:58:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 04 Mar 2024 17:58:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1709593089; x=1709679489; bh=TG8pyywQ8nLMoE+dLkiL//MwC3A6zrbPd2r/WzUzL+k=; b= YRRi/b/FqL1bk1CJ6Wp4/5ZDeIplQvrmGp7J7wSJHgnhOm3e8TIm7vxYMZ4t2IMD py0Fw3CisywOpamGmgr69F9TBxhgfUyXWEwcEUWzz2xz890FMe42hwcTF2zxjX3f yAWn5mRhxy5myt1HM5lh++Y7PPAs+3jQijs3nY4RH5bLg43Ry9Uq3ankOkFwbwOg WS8soV/yJaFgPGeKkFR1eueW0lyjWmB+gRWoMy7er4b+KCpcjlLLDm63fYrZlq5c t3ZvQsTFpoFFsHtXq5zhY8PZ1ccJeb1zOg5+S5uqPCMvOSUwN9X3fSQhhF+d383i gwSqO72z6xvtG7AFp8da4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709593089; x=1709679489; bh=TG8pyywQ8nLMoE+dLkiL//MwC3A6 zrbPd2r/WzUzL+k=; b=jc+dfT6Tl3Jv57IZVMYzauUvjcJF/4+nvAEAbIJ2ge5f kPmdCuECVq+gt1YCKtm0HqSjm5ZXkDJ8F+JXvztyAkGjfqx4S0yPe1gJHlGuYBva Ai6L7XY2s2Vuk/roNzLKm1Isudh9wcPu+OnREhrawRYU4BXi5xt4983qJkRjR8d2 I8Xc68kud0wP+qVuaVGCfeeVa4xJ0AVVQZVquWcnBLjegphMUjWciYkjwoqQZsCe OUX7CX5LHmqgERY/UCkfwiSYNPer9TcDf8AS1g1xc3IYeqxiSy0ksFsqkjQNisN5 +EAR6bFjGni2NjDREZ2RS7dA5lGoftzarsTIgMRjmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheekgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeffvghmihcu ofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinhhgsh hlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeduieelfeeutedvleehueetffejgeej geffkeelveeuleeukeejjeduffetjeekteenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpeguvghmihesihhnvhhishhisghlvghthhhinhhgshhl rggsrdgtohhm X-ME-Proxy: Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Mar 2024 17:58:09 -0500 (EST) Date: Mon, 4 Mar 2024 17:58:05 -0500 From: Demi Marie Obenour To: Greg KH Cc: linux-usb@vger.kernel.org, Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= , Linux Kernel Mailing List Subject: Re: usbip doesn't work with userspace code that accesses USB devices Message-ID: References: <2024030406-kilogram-raving-33c5@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ilsjY3LIWibyEmY7" Content-Disposition: inline In-Reply-To: <2024030406-kilogram-raving-33c5@gregkh> --ilsjY3LIWibyEmY7 Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Mon, 4 Mar 2024 17:58:05 -0500 From: Demi Marie Obenour To: Greg KH Cc: linux-usb@vger.kernel.org, Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= , Linux Kernel Mailing List Subject: Re: usbip doesn't work with userspace code that accesses USB devices On Mon, Mar 04, 2024 at 09:04:00PM +0000, Greg Kroah-Hartman wrote: > On Mon, Mar 04, 2024 at 03:01:51PM -0500, Demi Marie Obenour wrote: > > Qubes OS users are reporting that MTP doesn't work with USB passthrough. > > Fastboot (used for flashing a custom OS to an Android device) also > > doesn't work. Kernel-mode drivers, such as Bluetooth and USB storage, > > seem to usually work as expected. Since MTP and fastboot are both > > implemented in userspace, it appears that there is some problem with the > > interaction of usbip, our USB proxy (which is based on USBIP), and > > userspace programs that interact with USB devices directly. > >=20 > > The bug report can be found at [1] and the source code for the USB proxy > > can be found at [2]. The script used on the sending side (the one with > > the physical USB controller) is at [3] and the script used by the > > receiving side (the one the device is attached to) is at [4]. All of > > these links are for the current version as of this email being sent, so > > that anyone looking at this email in the future doesn't get confused. > >=20 > > Is this a bug in usbip, or is this due to usbip being used incorrectly? >=20 > I'm amazed that usbip works with usbfs at all, I didn't think that was a > thing. If it isn't a thing, then how would one go about making it be a thing? usbfs not supporting usbip would certainly explain the behavior we are seeing, but this also means that usbip is not a complete solution for our use-case. I had assumed that usbip simply created a new USB device that was just as functional as any device implemented in hardware. > If you have a reproducer, or some error messages somewhere, that might > be the easiest way forward. Multiple users have 100% reliable reproducers, and I believe (but am not certain) that Marek can reproduce this problem too. Writing a reproducer that doesn't involve Qubes OS or any USB peripherals would be quite a bit harder, mostly because I can't think of any way to run into this bug without either having least two machines (either physical or virtual) or using usbip from a machine to itself (which would be rather strange and might throw things off). It would also be necessary to somehow emulate the USB device in question. > In reading the bug report, it looks like > the "bridge" you all made can't handle the device disconnecting itself > properly? But that's just a guess, could be anything. What is the proper way to deal with disconnections? It's quite possible that the shell scripts have a bug somewhere, but I'm not sure what it is. --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab --ilsjY3LIWibyEmY7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmXmUf8ACgkQsoi1X/+c IsE/2A/9H+G2h93AG01v1CtSfs0PG33pqtVXxaOkYD/6ccY2xyEw30GnX6gUwI7B 3FxdVUdb4GoSqxup+e6ZpRWIjoaBl9vkrWft0mbwP2ImNUGrdBj4E2sZY3q3vL+Z 93YUIusxM45LrSdEzIv0dJGtC4BFTfAcoc9EtZk3LP/Z5qvnDDIqpfeKhnKbKDHs tV9AkywL0J9ZLRWYACe6yYVw7RvMyqZvAmTcZLaT4XniDt7R0dbrEyBQupND5OZl sku8xX6MujHPxOGfBB0GuE3E4Oos208LlDN2l8BgnXY+iGY7b3l1MSjYa6RJgxRD Iy3IxkpvoYfzB3qZGV4RY0bQcVrRBRIPaEiBRpKTVd+JlPccLu+17cRVOeVDSBMU SpDHr56Op9cOEstYyH0Kfho2ADY8v1H2SX5c5h1uJ6te7NPYKiYkfL+PqbxWsEl6 ehgqUqfGmM9Hk9Hb7R/GAxIvDeOAanDLPf6kJGwa4f8ySxWPFgXutEP02t6k3SKT MW3oEJex16Cjk2zp4QpCINTgRcJKhGt3HDX4tWJhxllMaCXROrr+tyt/P0eSC06a raIsvnC1eYaYeZIN/Tk3uXThXF36qWJKO+jQY0neaq5r4QC+QSil2xXJWgjsTcPW v5Ncczvw8LBrRUoPcn/93WptF4WJDgow2vvHRH6NfXVZHxR9Ns4= =DPIT -----END PGP SIGNATURE----- --ilsjY3LIWibyEmY7--