From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84260C48BDF for ; Fri, 18 Jun 2021 07:45:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52CBD613AA for ; Fri, 18 Jun 2021 07:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233235AbhFRHrV (ORCPT ); Fri, 18 Jun 2021 03:47:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:59714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhFRHrU (ORCPT ); Fri, 18 Jun 2021 03:47:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6961F61209; Fri, 18 Jun 2021 07:45:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624002312; bh=AzEqX9iqReB96AmmB8nBug8vqWqgKfEoGddrvCDjPOY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L7zREJrj24+QTYOHgUQH42JHTf06Y5wT/xtYiRaTmg3thLLW5An9Ydnw58WsYAQgk YEVO+irdM/Oo1RBEQVIjnuBVT4p/6lmxcBeflzhRlPw1dlt7r9A/DNJiDSeRW5RZGK pvt0nokzABNWUuPfkduuxttrU7gyX9pWCPkURlM0= Date: Fri, 18 Jun 2021 09:45:09 +0200 From: Greg KH To: Li Jun Cc: peter.chen@kernel.org, stern@rowland.harvard.edu, linux-usb@vger.kernel.org, linux-imx@nxp.com, zhipeng.wang_1@nxp.com Subject: Re: [PATCH v2] usb: chipidea: host: fix port index underflow and UBSAN complains Message-ID: References: <1623999879-2277-1-git-send-email-jun.li@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1623999879-2277-1-git-send-email-jun.li@nxp.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Fri, Jun 18, 2021 at 03:04:39PM +0800, Li Jun wrote: > If wIndex is 0 (and it often is), these calculations underflow and > UBSAN complains, here resolve this by not decrementing the index when > it is equal to 0, this copies the solution from commit 85e3990bea49 > ("USB: EHCI: avoid undefined pointer arithmetic and placate UBSAN") > > Reported-by: zhipeng.wang Please use a name here that makes sense, "Zhipeng Wang"? thanks, greg k-h