FAILED: patch "[PATCH] USB: serial: cypress_m8: fix memory corruption with small" failed to apply to 6.18-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x e1a9d791fd66ab2431b9e6f6f835823809869047
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026060436-outcome-uptight-239a@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e1a9d791fd66ab2431b9e6f6f835823809869047 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Fri, 22 May 2026 12:16:21 +0200
Subject: [PATCH] USB: serial: cypress_m8: fix memory corruption with small
endpoint
Make sure that the interrupt-out endpoint max packet size is at least eight bytes to avoid user-controlled slab corruption or NULL-pointer dereference should a malicious device report a smaller size.
drivers/usb/serial/cypress_m8.c +8 -0
@@ -445,6 +445,14 @@ static int cypress_generic_port_probe(struct usb_serial_port *port)return -ENODEV ; } +/* +* The buffer must be large enough for the one or two-byte header (and +* following data), but assume anything smaller than eight bytes is +* broken. +*/ +if (port->interrupt_out_size <8 ) +return -EINVAL ; + priv = kzalloc_obj(struct cypress_private);if (!priv)return -ENOMEM ;
Johan Hovold
maintainerPATCH 1/1 USB: serial: cypress_m8: fix memory corruption with small endpoint
commit e1a9d791fd66ab2431b9e6f6f835823809869047 upstream.
Make sure that the interrupt-out endpoint max packet size is at least eight bytes to avoid user-controlled slab corruption or NULL-pointer dereference should a malicious device report a smaller size.
---
This one should apply to 6.18 and earlier trees that lack kzalloc_obj().
Johan
drivers/usb/serial/cypress_m8.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/usb/serial/cypress_m8.c +8 -0
@@ -445,6 +445,14 @@ static int cypress_generic_port_probe(struct usb_serial_port *port)return -ENODEV ; } +/* +* The buffer must be large enough for the one or two-byte header (and +* following data), but assume anything smaller than eight bytes is +* broken. +*/ +if (port->interrupt_out_size <8 ) +return -EINVAL ; + priv =kzalloc (sizeof (struct cypress_private ),GFP_KERNEL );if (!priv)return -ENOMEM ;
Signature · 1 line
2.53.0
Re: [PATCH 6.18.y] USB: serial: cypress_m8: fix memory corruption with small endpoint
Quoted 1 line
[PATCH 6.18.y] USB: serial:
cypress_m8: fix memory corruption with small endpoint
Queued for 6.18.y, 6.12.y, 6.6.y, 6.1.y, 5.15.y and 5.10.y, thanks.
Signature · 2 lines
Thanks, Sasha