From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795960460; b=TGmWsKMPw0iC22fl5NGGAV1b7naJpAm2fkT0vdCAb6z3Hpuy9jwN01As+u+GebV+H1XY BnR5n+sjJvXMa89rB3PxILS3p5QULZj7Ml9KVHNqNiLT/TA36tdD9d1614HWXE8bQbgtJ h5I7oDgySEPyIZW4wi+6qqoJoapi/5Q54lKwK3Aykkdk1i07gd7xuMyCNGU3DwxTVT8SJ bRcV0+fvZB9kug40I4UKgnpXl7qOpCyVtzEjYqx4xnQVnq8qOE+7+EELJ4CwAvW8mbLOl dW+U3FY+S9V1gtqNV9uQfkovQIr+QoTXRFz2UqWh3t55s7vN7NnvifPKAXRLQgF/pCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795960460; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=Aql3rUn+aDQsrTIlA+Q+12++ekO+O30ySYo2Ra4Dlx0=; b=lXgQ7bCxMnIdmecoq5sbgU6Uy9mdedaxf5OpI3uM7MrenLvAkOwI84wUeM/lue41/3RF Gxw6eu9A7erI3OaU9sOHHThDNJtM62J7j981b18cX0SCI98ldrlW1cs9Sa75jAMwyv1Rz HDRRImpHKdCkJHqqqoO7o+eQFOmQLthURwDM1NV5BuwCCSPDp+Ns/iptEP1IK1rJi3zX7 rD7hs3tApP+Fm43oC9mYNndl8UvwL9UuirF8mILXFuWk3lUqy7yTN10Nnl0+gcESpR1Eq a1O+o47UpN4T1NMhHwqVju20h3zCMT3S/rhvFMwGd+VF/Af2H/oQ8iqtMOM1mY8O2TA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="e/Y4wmzu"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80161606A323 for ; Sun, 29 Nov 2026 13:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=e/Y4wmzu Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B6FF1F000C1; Sun, 29 Nov 2026 13:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795960460; bh=Aql3rUn+aDQsrTIlA+Q+12++ekO+O30ySYo2Ra4Dlx0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=e/Y4wmzuNOadGW1JDOvjyQSmQXSPmXhgqBuD/cmrBPWnIQPWtjq5KC/5STJm7+v1G VS7bzXIlYSbJ8E1uNtzgLbJAqg8gX2vE6DQYiGQ5xyRJIHp9cHthRnkenKLIIOj0+s i+ryQ/AVjqbsTMBVwXujbQspauWodSU8q4Z7IAOk= Date: Sun, 29 Nov 2026 14:54:15 +0100 From: Greg Kroah-Hartman To: Maoyi Xie Cc: linux-usb@vger.kernel.org, Christoph Jung Subject: Re: [PATCH] USB: iowarrior: ignore short reports Message-ID: <2026112925-skipping-ditto-bada@gregkh> References: <20261128084355.721820-1-maoyixie.tju@gmail.com> X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261128084355.721820-1-maoyixie.tju@gmail.com> On Sat, Nov 28, 2026 at 04:43:55PM +0800, Maoyi Xie wrote: > iowarrior_callback() copies report_size bytes of the interrupt-in > buffer into the read queue. It never looks at urb->actual_length. After > a short report the bytes past actual_length are stale or uninitialized. > iowarrior_read() copies them to user space. > > The vendor's datasheets describe only reports of a fixed length. Ignore > a report shorter than report_size. To be safe, as you don't have the hardware, why not just make sure the buffer is set to 0 so if anything "leaks" it's not actual junk? We've seen patches like this break things because drivers assume that they can handle these types of "errors" just fine. thanks, greg k-h