From mboxrd@z Thu Jan 1 00:00:00 1970 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 8FAC01A5BBC; Tue, 26 Aug 2025 12:59:52 +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=1756213192; cv=none; b=rFyMlQBL2OCg0vGjoiqVY9ZBTATerewZ50mKbFpCRYvFkaLxc+b87NrXrkGik7C4bRR1LXYR2tN8W9dYm0ijpYVM+x8TT82KgR+sWxPs4CWH6MfhiU9A5NCt+mAvxe89Jss6spIf4vPVtrqSJUg9z4B8t3KyJbn9GE5IHULWuK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756213192; c=relaxed/simple; bh=q/xXOUejIXHFQqAzmmtRBWLgIHDAzgZGRJkowdSZ89I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PHH2gzE0WoV3EP1sxP3mD9UJEOcKZB2gT6LaAsN2JkW2/1mnwm+3VnAlWJ8+5DOB8sf123up/rjD06qRQpiohZGL3cZYU5Ph12Ayed8HjceC7vuNH4r+ppZT0Z92y+NRyv68Rv3b6IIj2Wi5Gq1XYZTjm3GrlX6e8XUtp90idKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ah9FBMe/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ah9FBMe/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20E26C4CEF1; Tue, 26 Aug 2025 12:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756213192; bh=q/xXOUejIXHFQqAzmmtRBWLgIHDAzgZGRJkowdSZ89I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ah9FBMe/Ees9lMbSP24tZINTAG+gjdH7gxTvT7H1HfObRg0P+1rWQfrHFXj1RFSlp ksWYyHmGmTBhs5ddL0xsD+XlRy2mIk1K+VezzAU6cn2uHSJKU95RybIkhsuKuRyHHS RGOYM7mpFv3EBx3OUW/QsR84P+EzHAABNrFdoU48= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wolfram Sang , Hans Verkuil , Sasha Levin Subject: [PATCH 6.6 254/587] media: usb: hdpvr: disable zero-length read messages Date: Tue, 26 Aug 2025 13:06:43 +0200 Message-ID: <20250826110959.393697594@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110952.942403671@linuxfoundation.org> References: <20250826110952.942403671@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wolfram Sang [ Upstream commit b5ae5a79825ba8037b0be3ef677a24de8c063abf ] This driver passes the length of an i2c_msg directly to usb_control_msg(). If the message is now a read and of length 0, it violates the USB protocol and a warning will be printed. Enable the I2C_AQ_NO_ZERO_LEN_READ quirk for this adapter thus forbidding 0-length read messages altogether. Signed-off-by: Wolfram Sang Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/usb/hdpvr/hdpvr-i2c.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c index 070559b01b01..54956a8ff15e 100644 --- a/drivers/media/usb/hdpvr/hdpvr-i2c.c +++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c @@ -165,10 +165,16 @@ static const struct i2c_algorithm hdpvr_algo = { .functionality = hdpvr_functionality, }; +/* prevent invalid 0-length usb_control_msg */ +static const struct i2c_adapter_quirks hdpvr_quirks = { + .flags = I2C_AQ_NO_ZERO_LEN_READ, +}; + static const struct i2c_adapter hdpvr_i2c_adapter_template = { .name = "Hauppauge HD PVR I2C", .owner = THIS_MODULE, .algo = &hdpvr_algo, + .quirks = &hdpvr_quirks, }; static int hdpvr_activate_ir(struct hdpvr_device *dev) -- 2.39.5