Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3808445pxy; Tue, 4 May 2021 10:20:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/X5oeswTusyAiU4pk8otOcDwuwXrXQ61hgz3VyP1FZOqEgTRQj7tsev4+PluBvCOr9YgM X-Received: by 2002:a62:f202:0:b029:28e:96e7:a084 with SMTP id m2-20020a62f2020000b029028e96e7a084mr11385084pfh.59.1620148835508; Tue, 04 May 2021 10:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620148835; cv=none; d=google.com; s=arc-20160816; b=tsJ4BD1N4yY07LsIGreK47kGOaa7/aW7VxqfGGyAQ4vZ5n5yeOVVmP+cwjN6/u3tyx +dzXnomaQjcSJ9Ld67AQdHMH1M61aOiKbuBrCHtaxHWRwKJb9yoPqIKw9boWAPAswgyX QKLeDgYo1lDYNZlzLeuo2y/0fRKKWqQurSb0A+ITfLuSc6WHCT9hl5hYv6k4KEcEPKAX n5r6xQNFQuLmeLP6+vWDga3j3ZL5zO8Pjr97IaRGQi5vgzOhjlfiXYJzE9npTg61CNzq 2yqg0U9oU76oeYrZuenbk7kPrY5y0l7Dc66EFQpRlsLBG/BqwcDJZluajhYw52JaETro mpmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=alcE9l8sB5xDqjer1RS5x/soqRKmi67Hfqb8MJyqdoY=; b=SvmET+7s5sqjCZ+C+WsuztPhniwX7jpjixy1PE1Vx7Quk8YuAyDcsCFLbfcHZjHOR+ 00a9UUGSKK1pDoDuBOZ+Y6USsEQor/tSSlWuuqIl2+OpJaHgef7Nsdz9y6Zxer7vveOR naNsgzbbSAy/ni1CpZXqy+V7/HVNoC3WHdk0G6L3Fxss1M/0PGYIWMvzY+IC8qLkuAl7 bkH/n8PrUILFaimDTQLUm4BTTJDSRIyiwIwi1XKhrGaRfooSld7t6SW0vOUX+AEkBLGS 3X9noZSO970lxrJlO5XNdU4s++VFLqmDY34fcTH57jTnbyIggRFNFKuXXFPif/2wo2Fj 6umg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@quicinc.com header.s=qcdkim header.b=ddXPfL9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si4319791plp.290.2021.05.04.10.20.22; Tue, 04 May 2021 10:20:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@quicinc.com header.s=qcdkim header.b=ddXPfL9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231998AbhEDRUN (ORCPT + 99 others); Tue, 4 May 2021 13:20:13 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:44044 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232450AbhEDRUC (ORCPT ); Tue, 4 May 2021 13:20:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1620148747; x=1651684747; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=oLqJY8iRBomcrsfUAbDo2r1bL+Jw/tF2MChasblFrnI=; b=ddXPfL9U+uCK9lrIgqanxx6yxNrlhnMimbI5NHkXjR7O8tM0C1dzZrox qSL9fGMFBRYJptdI3cDLIzmb3T2EOm1zy7Jq6xWuqfeM79SMxC3r8A8Xq bSwabcbCmLEOQjpWjgTqOxdbr7V1tUnrBoMumlM+UMViHKeMqBzCcv7Ee s=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 04 May 2021 10:19:07 -0700 X-QCInternal: smtphost Received: from nasanexm03e.na.qualcomm.com ([10.85.0.48]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/AES256-SHA; 04 May 2021 10:19:07 -0700 Received: from [10.226.59.216] (10.80.80.8) by nasanexm03e.na.qualcomm.com (10.85.0.48) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 4 May 2021 10:19:06 -0700 Subject: Re: [PATCH] bus: mhi: core: Validate channel ID when processing command completions To: Bhaumik Bhatt , CC: , , , References: <1619481538-4435-1-git-send-email-bbhatt@codeaurora.org> From: Jeffrey Hugo Message-ID: Date: Tue, 4 May 2021 11:19:05 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <1619481538-4435-1-git-send-email-bbhatt@codeaurora.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm03f.na.qualcomm.com (10.85.0.47) To nasanexm03e.na.qualcomm.com (10.85.0.48) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/26/2021 5:58 PM, Bhaumik Bhatt wrote: > MHI reads the channel ID from the event ring element sent by the > device which can be any value between 0 and 255. In order to > prevent any out of bound accesses, add a check against the maximum > number of channels supported by the controller and those channels > not configured yet so as to skip processing of that event ring > element. > > Fixes: 1d3173a3bae7 ("bus: mhi: core: Add support for processing events from client device") > Signed-off-by: Bhaumik Bhatt > --- Reviewed-by: Jeffrey Hugo