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=1795035893; b=hp8xn96EJaGB9bgvfoRt4jgXwYRklP9fv8O99nEhPkTZG33xUr+wU0+GuCLQr9SaviIo sun1H9cr0b3NEjU93Towg0HukMuXvl6ZkJqeA2ExJjqtKeYT+zYY5X2Jr0h27I6QcBPZi dNvA0+Vg8bloFnuj6xBrpJZYmPr1vGs8fP8C69F0j64Z7GPHttbAIdETVsAg9O3CyI9Kv 4/eOu62leP/I6iXKlAnWpptpNdVRU5La5noizrg+HQHcXF1DunDv36wKmHlK+ijkt6lBC piO89GvxmNxgjC57pyGyFCck+oCe607kY/JIiWFLgl13c6vCp9GzxIOzp3esTmTLemw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795035893; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=NOEJGO8qqkoF5FfpiqwOpgktifcdElmQjHyd5+4nQJQ=; b=WQ+NsBq7BgKKkCtTMiKoyhgrThn/5hxD40OPMDWHxbGbmZHoTY79HrZOt37mWgC8hoqI AHlvxN7FCS+kpRgZ7EfEx+O3HasX2Wwk6O7A7bU40PgBqCCSPCHpgOWpTg+XIRrKjOV3M GUy8kgiMiEexpza4SnbScJixwvBRXUYlC95tlhwisaIT7cZNhVIkjUxnwqDHFdftrQljF c39W44S16vDXowRXWeLI23b6OOJo6fQzA+j4I2EesHhLY9XgRIFt+8G24buox/TLss6t8 x/5+ekqUVrLIYRqUKfjOqkvr2d0x34l+FnHfs4BkAutAqW7UqNGYWS2ki2AwLj3Un4w== 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=dLjb+q2w; 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 BD90F606CB48; Wed, 18 Nov 2026 21:04:53 +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=dLjb+q2w Received: by smtp.kernel.org (Postfix) with ESMTPSA id D68F91F000C9; Wed, 18 Nov 2026 21:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795035893; bh=NOEJGO8qqkoF5FfpiqwOpgktifcdElmQjHyd5+4nQJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dLjb+q2w1G645GxdsFXV+97KENc3Uh928VMQ9A18OcDyj5Y12I9Nw033Ovsjvtqdm yao6t7hLAGqHeFfAIDvbnkG4hwWhaHkGehhqo7LW+IGsVxWcf7g1DYlQV1e2c5ChjH ONwul1YEhGXsj53gY/7RG94TUjzl0OKCzQMj6MX0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, syzbot+ddccc0c0dbc0a38ffccb@syzkaller.appspotmail.com, Juan Perdomo , Hans Verkuil , Sasha Levin Subject: [PATCH 6.6 0864/3318] media: cx231xx: preserve I2C transfer length Date: Wed, 18 Nov 2026 15:24:46 +0100 Message-ID: <20261118150345.218951847@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Juan Perdomo [ Upstream commit a19c9502a69bbd42c18816b09cbefdeb4cb68066 ] The I2C core stores message lengths in u16, but cx231xx truncates them to u8 when populating cx231xx_i2c_xfer_data. A 0x700-byte read therefore becomes a zero-length request. USB treats zero-length control transfers as OUT regardless of bRequestType, so the IN control pipe trips the usb_submit_urb() direction warning. Use u16 for buf_size, matching both i2c_msg.len and VENDOR_REQUEST_IN.wLength. Oversized transfers then reach the existing URB_MAX_CTRL_SIZE check and return -EINVAL. Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver") Cc: stable@kernel.org Reported-by: syzbot+ddccc0c0dbc0a38ffccb@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=ddccc0c0dbc0a38ffccb Tested-by: syzbot+ddccc0c0dbc0a38ffccb@syzkaller.appspotmail.com Signed-off-by: Juan Perdomo Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/usb/cx231xx/cx231xx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h index 6929e4d97067a..4e00b082e3854 100644 --- a/drivers/media/usb/cx231xx/cx231xx.h +++ b/drivers/media/usb/cx231xx/cx231xx.h @@ -460,7 +460,7 @@ struct cx231xx_i2c_xfer_data { u8 direction; /* 1 - IN, 0 - OUT */ u8 saddr_len; /* sub address len */ u16 saddr_dat; /* sub addr data */ - u8 buf_size; /* buffer size */ + u16 buf_size; /* buffer size */ u8 *p_buffer; /* pointer to the buffer */ }; -- 2.53.0