From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D071E391842; Mon, 18 May 2026 05:19:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779081572; cv=none; b=AQXLgVGTeCoh/5wpf3zgIiFMRnUH9ZFZde0PrntDNCiAmahSnrWAt5/LYj6uGTohJCgmLhlxEfCTyhIvQ0uDj5Au0krCzDBvHPTSj4v+xG2gTFvE2IpkKCYule0O13weM1CopFGax+KDoylHcrbl17e3xg+9ZnIP1fyJ4f1mLRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779081572; c=relaxed/simple; bh=XgQnF6E0hAXr6C9UwWwmqeWHxO+ZWi4UQXpwE9r8/G8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aVVIgTM/dcWMKRM5L/D6RFBWnXYB9qO4dtY+/MdoodQB3gwtiMlJY1Nr3N6i6byRQm0qDlAdIW/WxQm/HwGoJe4aHAHR01udMCluiFSPxPw/MByvbNU5vJioyYwxhuaUhB9WZgM0jBr92AmJ0mSzS3tYGPAO4s41F4MAmbFXu8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rGIKvhoz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rGIKvhoz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4094CC2BCC6; Mon, 18 May 2026 05:19:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1779081571; bh=XgQnF6E0hAXr6C9UwWwmqeWHxO+ZWi4UQXpwE9r8/G8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rGIKvhozLSXeCYWhzC4u7R2BzYZBco3T+605zkBuJdO+CZmc08eCy3bfF47GqNcnY CK/YhfpCY13dvdad5wztkvlUdUe6iB56l6/s5r5e7Pwv2YqA2Yjn08ABqEk48nXkjQ 2QEd9tkqk9zNxHCJiayyWlQTWkYCHkCJmqpzog9g= Date: Mon, 18 May 2026 07:19:35 +0200 From: Greg Kroah-Hartman To: Seungjin Bae Cc: Kyungtae Kim , Kees Cook , Dan Carpenter , David Mosberger , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control() Message-ID: <2026051801-manual-helper-c7b3@gregkh> References: <20260517000145.1868817-2-eeodqql09@gmail.com> <2026051731-ripeness-wipe-ebf6@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sun, May 17, 2026 at 02:19:07PM -0400, Seungjin Bae wrote: > 2026년 5월 17일 (일) 오전 1:49, Greg Kroah-Hartman 님이 작성: > > > > On Sat, May 16, 2026 at 08:01:46PM -0400, pip-izony wrote: > > > From: Seungjin Bae > > > > > > So if a malicious userspace task with access to the root hub via > > > /dev/bus/usb/.../001 issues a USBDEVFS_CONTROL ioctl with `wValue` > > > greater than or equal to 32, the left shift operation invokes > > > shift-out-of-bounds undefined behavior. This results in arbitrary > > > bit corruption of `port_status`, including the normally-immutable > > > change bits, which can bypass internal state checks and confuse the > > > hub status. > > > > > > Fix this by rejecting requests whose `value` exceeds the shift width > > > before performing the shift. > > > > > > Fixes: 2d53139f3162 ("Add support for using a MAX3421E chip as a host driver.") > > > Signed-off-by: Seungjin Bae > > > --- > > > 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 0e17c988d36a..3d6b351dcb1a 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, > > > !pdata->vbus_active_level); > > > fallthrough; > > > default: > > > + if (value >= 32) > > > + goto error; > > > > Cool, what tool found this? I've been running some static checkers and > > I don't think it turned this one up yet. > > > > thanks, > > > > greg k-h > > Thanks for your interest! > > It's a KLEE-based symbolic execution tool I've been developing for > kernel drivers. It's still a work in progress, but I'd be happy to > share more details and the tool itself once it's in better shape. As per our documentation, you MUST document the fact that you are using a tool to find/fix things. Please fix up our newly submitted patches to include that information. thanks, greg k-h