Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp330694lqp; Wed, 12 Jun 2024 02:55:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvt/eEiweG01/VbtxdNPoWn/leWiADhLI5MrtSTdGLpIfAi407nP1Qrb6GjcC9ldvtUiC5woRlzgQc8Uy1R2A5Gur3bUeH5+BhMxoJkA== X-Google-Smtp-Source: AGHT+IF9EzEdc1+0PKhfhYOYo9UvJ0x9uI+5VXws8lR2/y96b+eTAtJHKkgbIqmFRdMVluxUpXIv X-Received: by 2002:a05:6a00:2284:b0:6f3:f5e8:31f7 with SMTP id d2e1a72fcca58-705bcdcfb9cmr1687925b3a.7.1718186141224; Wed, 12 Jun 2024 02:55:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718186141; cv=pass; d=google.com; s=arc-20160816; b=JFRJSfTIWgjVPi87jsbBNTo/9Ng3/JHdAYp5FGDjVizTMfNGLjXt6TnLFUH83NCNl0 1oNx42QbyRwYHv42i2WNE3sMLRVSQV3h4XPBcxjSg51vX7gYov5ZuFWmjXLFXJjbHs9P cYrzszp/Ilt8NoVr5VvhdhUlgIug5Y49sAQKUETjfgNGANNQoRog4BHTeG7l4MgXl9Pk 6187Oa3iqfPYhr2NRbieJOPFG1q9BRKIKYeBd+My+irxnuoWJ0GJKfglUqQen/A+S9bL AqAbG9skw+XAqXKBIn7KHbgwXA3m/ztc+h6Nd+v9S0/PEeUC9zDDEnta8+kMtvTBHV0L Nrag== 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:dkim-signature; bh=QYG3HJPS5nPC/syRBhSus9Vd6Jp3CtLX99jpEbzk8w4=; fh=mg0Kg5tzq4NIFxE0Qjg69gs3z59L9w4uKQia0cxzonE=; b=SaPRhAq/eVKGoNCzGD4Enx1njWLMcx1n0cwlnySDKxWL891aTeQB91mTZkNdtTssZl cRpQiaketxatQ+bHIFyX+CD/uBEpHjDlfKljaUGJqy4cHjggIGxsy1IIBC9Crj4Lpftv Kh10EPfDhMbrs1XOYv6+8eTk1mx8kFmgwo67PRZLadq1if24A3uJ22YxicZD0MbanoTU l1SZLbygSvEp2omX8iZT+q5xNjekTbZ/v0p4r26J/dpA3Fwe1/QRsww06YTUSR9G98aM aZqwOiGymo5rMvqVKPVmS00ouNemF7HN/3LQaeyR9woLdHSXvHqufjU1/M4w/mfePMXe 1l8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wbgQ/ePR"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-211306-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70423c8ea87si7645445b3a.176.2024.06.12.02.55.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 02:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211306-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wbgQ/ePR"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-211306-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 EA153283BEE for ; Wed, 12 Jun 2024 09:55:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B397916E863; Wed, 12 Jun 2024 09:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wbgQ/ePR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 74C1AA34; Wed, 12 Jun 2024 09:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718186120; cv=none; b=a2w/3oYpp1k6xJia5g2Tkcm+GbXaP0c7K6vSesFVNNe8+2x8m2fXGYQ5imhFFzlxLuLE0EoOlxBEUgWr8IBT1E7ULi+iZxjRUYlCPA+QNfOXvTm9zJ3RqelZ1y38t2jNNl5lsXpoFVr+rkqqL52EUpwilUrpj7/d0ya0h40zQvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718186120; c=relaxed/simple; bh=IUlWQQqW3cQb1qb4NtDCHI7QOQj5j7JMOhaHKauOiNI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=W0/FkcMPd9Aebfje/obsl9HEfSdpDdrfCgx4MroCZjdCTxkOeM5/HBHUGztdvLIlNGR6ElStJf47pibM5mYHaBjyYl9BuFZOiCtVNICvpSNWVWMm5hBNHTtDJlLKulK/An06TVvahaalr9/TlFPjY/M90a7eeCUUmWmCShFHi3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wbgQ/ePR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A594C3277B; Wed, 12 Jun 2024 09:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718186119; bh=IUlWQQqW3cQb1qb4NtDCHI7QOQj5j7JMOhaHKauOiNI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wbgQ/ePRCJCuF1v4mZFoS9pFDhM27kHeWXMuh9OoDCTYgnuVBWGotLmRaILAdj/jH +c10ngXD8YNfyoD9n+CACwFleSSp4TXlsfzqrFQgimCIsTxeQQymsWqvrSL0zvSsPm AQL7L0BdYfUUPgjdysWu4HYqXWaoGXE4ZZrGnmEw= Date: Wed, 12 Jun 2024 11:55:17 +0200 From: Greg KH To: Alan Stern Cc: Oliver Neukum , USB mailing list , Kernel development list Subject: Re: USB Denial Of Service Message-ID: <2024061236-diabolic-wisplike-d2b1@gregkh> References: <40dfa45b-5f21-4eef-a8c1-51a2f320e267@rowland.harvard.edu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40dfa45b-5f21-4eef-a8c1-51a2f320e267@rowland.harvard.edu> On Tue, Jun 11, 2024 at 10:35:12AM -0400, Alan Stern wrote: > Greg, Oliver, or anyone else: > > Questions: > > If a broken or malicious device causes a USB class driver to add a > thousand (or more) error messages per second to the kernel log, > indefinitely, would that be considered a form of DOS? > > Should the driver be fixed? Good question. Right now, by default, we "trust" usb devices to an extent. We have been "pushing back" that boundry over time, such that now we will validate USB descriptors to verify that they actually are sane before allowing a driver to bind to them, and if there's any bugs with that, we will fix them. But we totally trust the data stream from devices, and trust that once an urb is submitted, they work properly. If we wish to change that threat model, great, but that will require those that wish to change that model to DO THE ACTUAL WORK! I don't want to see fuzzers start to fuzz the data streams of USB drivers and expect us to fix the bugs. That's flat out not ok, as this is something that right now, we do not care about. If companies do care about this, they need to do the work as that is NOT how Linux is currently designed and implemented. Same goes for other device types. I get this conversation all the time (had it last week at a very very very large Linux company.) It usually goes something like: Them: We want to claim that we can trust drivers to work properly for malicious devices Me: Wonderful, send the patches to do so, fixing up all subsystems that rely on them! Them: No, that's something that Linux should already support. Me: Why do you care about this? Them: Because we want to host systems in untrusted situations. Me: So you want to save money by not using a single physical host. Them: Yes. Me: Then spend some of that money to do the work to make this happen, do not force the community to do it for you. Them: ... > What is an acceptable rate for an unending stream of error messages? > Once a second? Once a minute? The *_ratelimited() functions should handle this if you want to use them. > At what point should the driver give up and stop trying to communicate > with the device? That's tricky, we don't have good answers for that as everyone has a different idea of how long "flaky" devices should be able to flake out before coming back. > (These are not moot questions. There are indeed drivers, and probably > not just in the USB subsystem, subject to this sort of behavior.) Totally agreed. But again, the design of Linux right now is that we implicitly trust the hardware we are running on. If that design decision wants to be changed, some people need to do a ton of work to change it. Thanks, greg k-h