From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 17C3435C6A0; Tue, 21 Jul 2026 21:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669257; cv=none; b=lQ5IFgM7t/HH5+uXQz/R2r5z8R3cTpsEaudjNI0fT7eNwNXYNgDelwOMK7dh55vsDSBkFxbMzvD4nR+71muAx53kRIoK0ZTUKzb6M/w0gqd8M1Pg5umh8j3XFX09rFpk3JJnuPQM6Tv9bddkViDF4cTNtn6rwJx6/N9dha8XOOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669257; c=relaxed/simple; bh=ck4hB67LpSSwe7m2iZ6bEr5tZGe2Pm0gBpc79umfytI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d0QfDlsJev95i373PwBlx2EZIYkk+sEBlJTWeKV7D79Ugz37mPMfGZ7inP4x+Y4F45EQpCn2GiH084oxXqvZfSaYlljdb9DIKpZfRgXnQj/q0SpUb+r4a/u833ad3dJvcZX1zvP5nD0XJfHBtD503taLE1xoTvAS4f3FiLsphUE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MzO3EocR; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MzO3EocR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7369F1F000E9; Tue, 21 Jul 2026 21:27:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784669256; bh=gAqbasVdBsAQnAibgGz9jFPOTeMU0uhHBW3p65Jj++o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MzO3EocRiSkPKKgT+SuYu3RezRY7QCPcHkw+9OnTBp8KIAXo0tS/oTkU6NN2KOEAB 0rhBTqAvuxflhZPumb33Drv2RKU8S4b8PLVC25uXaXWJLRS3eYHaMjJa6uPtSyD9UJ cTlnQOflzrzpV7rGxkjwhYz09YVcMRE3yTSbmqbQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alan Stern , Seungjin Bae , Sasha Levin Subject: [PATCH 6.1 0487/1067] usb: host: max3421: Reject hub port requests for non-existent ports Date: Tue, 21 Jul 2026 17:18:08 +0200 Message-ID: <20260721152435.510832834@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@linuxfoundation.org> User-Agent: quilt/0.69 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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Seungjin Bae [ Upstream commit 11b5c101e2fd206104b05bc92554d356989423a8 ] The `max3421_hub_control()` function handles USB hub class requests to the virtual root hub. The `GetPortStatus` case correctly rejects requests with `index != 1`, since the virtual root hub has only a single port. However, the `ClearPortFeature` and `SetPortFeature` cases lack the same check. Fix this by extending the `index != 1` rejection to both cases, matching the existing behavior of `GetPortStatus`. Fixes: 2d53139f3162 ("Add support for using a MAX3421E chip as a host driver.") Suggested-by: Alan Stern Reviewed-by: Alan Stern Signed-off-by: Seungjin Bae Link: https://patch.msgid.link/20260518224901.1887013-3-eeodqql09@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/max3421-hcd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index 7f948ec94305ef..24611352efd1c3 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c @@ -1694,6 +1694,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, case ClearHubFeature: break; case ClearPortFeature: + if (index != 1) + goto error; switch (value) { case USB_PORT_FEAT_SUSPEND: break; @@ -1737,6 +1739,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, break; case SetPortFeature: + if (index != 1) + goto error; switch (value) { case USB_PORT_FEAT_LINK_STATE: case USB_PORT_FEAT_U1_TIMEOUT: -- 2.53.0