From ae331090c6e9c3cb2484f9a3f0c937e3b886c6fe Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 15 Oct 2024 13:33:54 +0200 Subject: [PATCH] drop queue-6.11/usb-typec-ucsi-don-t-truncate-the-reads.patch --- queue-6.11/series | 1 - ...-typec-ucsi-don-t-truncate-the-reads.patch | 57 ------------------- 2 files changed, 58 deletions(-) delete mode 100644 queue-6.11/usb-typec-ucsi-don-t-truncate-the-reads.patch diff --git a/queue-6.11/series b/queue-6.11/series index c31067bb5ac..a9ea2fb20d6 100644 --- a/queue-6.11/series +++ b/queue-6.11/series @@ -52,7 +52,6 @@ remoteproc-imx_rproc-use-imx-specific-hook-for-find_.patch clk-imx-remove-clk_set_parent_gate-for-dram-mux-for-.patch serial-protect-uart_port_dtr_rts-in-uart_shutdown-to.patch usb-typec-tipd-free-irq-only-if-it-was-requested-bef.patch -usb-typec-ucsi-don-t-truncate-the-reads.patch usb-chipidea-udc-enable-suspend-interrupt-after-usb-.patch usb-dwc2-adjust-the-timing-of-usb-driver-interrupt-r.patch xhci-dbc-fix-stall-transfer-event-handling.patch diff --git a/queue-6.11/usb-typec-ucsi-don-t-truncate-the-reads.patch b/queue-6.11/usb-typec-ucsi-don-t-truncate-the-reads.patch deleted file mode 100644 index 652d4a75b06..00000000000 --- a/queue-6.11/usb-typec-ucsi-don-t-truncate-the-reads.patch +++ /dev/null @@ -1,57 +0,0 @@ -From b56e61eb89890a31b0c41056fb5d3a6d9688454f Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 16 Aug 2024 16:58:55 +0300 -Subject: usb: typec: ucsi: Don't truncate the reads - -From: Heikki Krogerus - -[ Upstream commit 1d05c382ddb4e43ce251a50f308df5e42a2f6088 ] - -That may silently corrupt the data. Instead, failing attempts -to read more than the interface can handle. - -Signed-off-by: Heikki Krogerus -Reviewed-by: Abhishek Pandit-Subedi -Link: https://lore.kernel.org/r/20240816135859.3499351-3-heikki.krogerus@linux.intel.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/usb/typec/ucsi/ucsi.c | 8 ++------ - drivers/usb/typec/ucsi/ucsi.h | 2 ++ - 2 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c -index 8cc43c866130a..8a81fec9efe36 100644 ---- a/drivers/usb/typec/ucsi/ucsi.c -+++ b/drivers/usb/typec/ucsi/ucsi.c -@@ -103,12 +103,8 @@ static int ucsi_run_command(struct ucsi *ucsi, u64 command, u32 *cci, - - *cci = 0; - -- /* -- * Below UCSI 2.0, MESSAGE_IN was limited to 16 bytes. Truncate the -- * reads here. -- */ -- if (ucsi->version <= UCSI_VERSION_1_2) -- size = clamp(size, 0, 16); -+ if (size > UCSI_MAX_DATA_LENGTH(ucsi)) -+ return -EINVAL; - - ret = ucsi->ops->sync_control(ucsi, command); - if (ucsi->ops->read_cci(ucsi, cci)) -diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h -index 5a3481d36d7ab..db90b513f78a8 100644 ---- a/drivers/usb/typec/ucsi/ucsi.h -+++ b/drivers/usb/typec/ucsi/ucsi.h -@@ -435,6 +435,8 @@ struct ucsi { - #define UCSI_DELAY_DEVICE_PDOS BIT(1) /* Reading PDOs fails until the parter is in PD mode */ - }; - -+#define UCSI_MAX_DATA_LENGTH(u) (((u)->version < UCSI_VERSION_2_0) ? 0x10 : 0xff) -+ - #define UCSI_MAX_SVID 5 - #define UCSI_MAX_ALTMODES (UCSI_MAX_SVID * 6) - --- -2.43.0 - -- 2.47.3