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 1A18D46D2CF; Tue, 21 Jul 2026 18:05:42 +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=1784657143; cv=none; b=htIUNM4xMY6ePIlCp8MX2iSgID0XHtu7osYWp0kQwoKsl2Ccrspy6/sEOS44oDf/wGUePRTWfvdowLgZmT4QXBWwRZ4pPe0GIrqQN0QLw59DxJsc6a+setx7Eq+n6eIPQavy6hi1YZortoZ93wlou2+rzykRHeH0sB5Yz+TB/rE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657143; c=relaxed/simple; bh=BfqgHZnYXJso1Rygy7ajCqPhLS47CXArtbqqtWJFsFo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ACrg/bNF/h8USWDnbvdDgWefjFKBT2l7rJ2OIekTdEqIMrU1fH12DaMFZyl7P5bHsImdZ+KG2jaLJjUtKSBOrCHRd/KaQgWizzt4W9ar8oVMa6jpZZEbHPa1q0shdk1UB4ch38215WkKe15xuuLgGvpHmozW6JrFkV3JApZERMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mv8W+6EQ; 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="mv8W+6EQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A7F41F000E9; Tue, 21 Jul 2026 18:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784657142; bh=yPeQzUuctZ2Bnq/6Bpl50dMN54AdsEGWztHy9c22A+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mv8W+6EQuuhfvITtyCE6kSiL8zQzrIiICydQy+W92VXnHdPR6bvEJ3xe66rVQyImi o0ywNF5sDIgW+SD5cV7VEgVARSeCT+gdvrygxE2SHn6kbOmGUJO3JilkbfK7JjHVxo GberrZgvrjaOMVil/yd6pivbv5M5vd6ZTykMJWSI= 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.18 0610/1611] usb: host: max3421: Reject hub port requests for non-existent ports Date: Tue, 21 Jul 2026 17:12:06 +0200 Message-ID: <20260721152529.107300207@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@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.18-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 823dc61d31e86b..8fbbf9e195b0a4 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c @@ -1685,6 +1685,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; @@ -1728,6 +1730,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