Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp538321rdf; Fri, 3 Nov 2023 07:56:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEf3I9mVIeiz3PwMidd2uqur7kR/eJ3IPI5kBAiq8xJEwawSKMtkNJiubOYXIaUANE+DzHA X-Received: by 2002:a05:6a20:1383:b0:17a:fa76:805f with SMTP id hn3-20020a056a20138300b0017afa76805fmr18473672pzc.23.1699023375360; Fri, 03 Nov 2023 07:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699023375; cv=none; d=google.com; s=arc-20160816; b=a1saDuMSACWD1STWd3rY8fuJjflNBTbA7NQN3qcdHeGLsTAN0eGQNASRXXL6dBjh7y IqJAi6+iAzPjxbK19VVN1xkFLroD54VKd0Lwp9SXGhaK1WDa1oatRLGUsvA43LAJaO2V 4RS1KacJRM2CrBwdk5FLRTQURe9cfUlQHukIEQjSzZz6SyuU4w8utat+rteHuUsNQ5LX wccCHMjnX6Fb0IZIEB9jO9Da14kEqCmi/V4o5hBRTRNJh4daV4993DEWcjxZZ8z52x8M CHJcVXEapW9/P709tNuO0WP+1sjUzl1ibjQQLEoNWj8PyuOstPF5QVQ96IUV2Ysh8pDX Ufgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SRX3DzU8Q98DBMKkC4Etz13c6p82qvG1cDTvgF3VPIA=; fh=i6Cduf3L9N9kTO9S3VntHQwzzn5khKpBYqfnoQTS/R4=; b=082N08WMj1ITbOhybXP37HwB2JsRUm+KbYFa45rRVxitDzMZWiGqtItTjppCP+pmxF De5LOoJr6/qgjrXuzrZt0GlfoWykkrXmXymUN5YRykStxvQe8zcKgZQWSO7NG2Z8XI89 ypHqJ5u/nyNFlP2291kLvuGme+iz4BV5v3gYk0hFs7WWSDUdBkAWsm2Xvg1qrcWePMBA jN5jKYTZP8SZngPQEtCtlydYXdppH4kMZdY2KKkA+GkGgD54W4qjUpF5koMGiN3Sx7zO rat6t8jbDCKhfrExlzMtQC4iSj3uBayKIny9TX90MCryir7xHE87pqF1PQz8t5EjTHW1 0XpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LoujGUSP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j10-20020a056a00130a00b006c1691263cesi1620289pfu.291.2023.11.03.07.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LoujGUSP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 28E3F8090E9D; Fri, 3 Nov 2023 07:55:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231797AbjKCOzS (ORCPT + 99 others); Fri, 3 Nov 2023 10:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjKCOzQ (ORCPT ); Fri, 3 Nov 2023 10:55:16 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB32D47; Fri, 3 Nov 2023 07:55:10 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A3BZGUK031141; Fri, 3 Nov 2023 14:54:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=SRX3DzU8Q98DBMKkC4Etz13c6p82qvG1cDTvgF3VPIA=; b=LoujGUSPM42TnFen7aAHwTkDTY9TvGfTWuEsu/r3ld4cz2OYKOh60yJtyBMAzbHV4ixF dvpmpWaS8Zj0Wmq6F6FinlEi/kfcNJ+3WbhhKBbuQjHavkUpfwdvNLJWLOQmNAzw0tmb H+DhZ5h+mIJvoKrd7SqcIq7rg4fd9uoriEzyzYwbKO3bBosCtawg+Vh0ULuU06oAGtqu lGW0NWEvzhd7yoyzroIdp8WHI4eEZ7O+xc5XhADnyw8aChw7/BqTy2Ci5ePY6oDU6Wc3 pkbT6dyg/+mbrmB2b3a5nT+HWlVJUZVPCWoEO2ViqVxKLbzN+z865mGP8bAF8+MQ2vT6 EQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u4v8mrv1a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 03 Nov 2023 14:54:50 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3A3Esnin010057 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Nov 2023 14:54:49 GMT Received: from [10.226.59.182] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Fri, 3 Nov 2023 07:54:48 -0700 Message-ID: Date: Fri, 3 Nov 2023 08:54:47 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v2] bus: mhi: host: Add alignment check for event ring read pointer Content-Language: en-US To: Krishna chaitanya chundru , "Manivannan Sadhasivam" CC: , , , , , , , References: <20231031-alignment_check-v2-1-1441db7c5efd@quicinc.com> From: Jeffrey Hugo In-Reply-To: <20231031-alignment_check-v2-1-1441db7c5efd@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: -6yagfbWKFV8XRLTsw_EcuwOF5y62VtZ X-Proofpoint-ORIG-GUID: -6yagfbWKFV8XRLTsw_EcuwOF5y62VtZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-03_14,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 bulkscore=0 impostorscore=0 mlxscore=0 malwarescore=0 mlxlogscore=883 spamscore=0 clxscore=1011 suspectscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311030125 X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:55:34 -0700 (PDT) On 10/31/2023 3:51 AM, Krishna chaitanya chundru wrote: > Though we do check the event ring read pointer by "is_valid_ring_ptr" > to make sure it is in the buffer range, but there is another risk the > pointer may be not aligned. Since we are expecting event ring elements > are 128 bits(struct mhi_ring_element) aligned, an unaligned read pointer > could lead to multiple issues like DoS or ring buffer memory corruption. > > So add a alignment check for event ring read pointer. > > Fixes: ec32332df764 ("bus: mhi: core: Sanity check values from remote device before use") > cc: stable@vger.kernel.org > Signed-off-by: Krishna chaitanya chundru Reviewed-by: Jeffrey Hugo