Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp18856rwb; Thu, 22 Sep 2022 13:44:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4nEebKebEKme+7Xh3/CKG5plLbjryllYDInKAG1aGKrsnzIY01OOJlkbhe4YCS1KLbh3Pa X-Received: by 2002:a17:90b:2686:b0:203:bf90:f791 with SMTP id pl6-20020a17090b268600b00203bf90f791mr5807245pjb.50.1663879497007; Thu, 22 Sep 2022 13:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663879496; cv=none; d=google.com; s=arc-20160816; b=c4fK81y9R6jY7k4dngLBth9TqCcIgIH1WW4/AyaOEfPq4gvJWft1al6gt1DcUdSy1a 6nPhOWKxAKtQrqunJBtq+xl+TsVQzurb+MtgUigWK3x50jV8kZrgugFuAsKMkcCLg7Wj nBK4u/ecAK6kL8B2s2fxXuSmtOfs1AH1Kr5W98h0Zd3tiejHfx1U5Z4L5yxR2KxYTwHY prrfY9llyNaPeM80/xsHoFMfW93QQVm3ZzWNLZTQybYGPl6h2skYzWGDE2jHtAJRYKMv Y6d30EqfqpLreIic3xERbKNxCR4YZ/lDrxxqVlZEZaxtYKET+e8TMGPBhwno2CwFsflE UJtw== 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=1pMaUoTR3YrWZWr8YoQKMxOkKXfqTTJJFPlXZWdqh80=; b=XMfbhAnajt1MpSLdj+yM1VUaqnUxXeVgTo1pOKofxdorxj2iUzzaTV7EYreh+ejh6t D+8mjEHb0DqEwaFEbje1IZ13xBE7S8sXDePXsxg9yyZHEBvezYERSRDkUxFiRdgQDeLv 6o87HT7u8a7cS/757GHbxqZtRKhdNefkCwqTqVuB0Yci007uj6tmcKYmKFGjMqk0tpRq mU4QgqsDSSxh1ZzrYMVmvqp1m1YFtmGQIq4OoDDxZHk0ZqQIlbFW4iHDsylmW6vUln1b lZKa9B1HUH33ZqQo0Y0zXj8XBmt2UneEjQEcoIZq/i730mUP0fmCE8b+RTrmuEEbVAaG xNRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Pwax92A9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a056a00140700b0053622c49905si7454416pfu.289.2022.09.22.13.44.45; Thu, 22 Sep 2022 13:44:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Pwax92A9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231317AbiIVUCQ (ORCPT + 99 others); Thu, 22 Sep 2022 16:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbiIVUBv (ORCPT ); Thu, 22 Sep 2022 16:01:51 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E3E02F02C; Thu, 22 Sep 2022 13:01:34 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28MJNfii011612; Thu, 22 Sep 2022 20:01:21 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=1pMaUoTR3YrWZWr8YoQKMxOkKXfqTTJJFPlXZWdqh80=; b=Pwax92A9FQ04+cU34eb4mvfB88pF0O8M9sFISJQxW00slRE1uhyV7fU+AyLGAwOcUQYq GGPA2dHRsj4iY1PhZL+nVBq0n1wExSfuMa1XbzCV5HvdFdzsFRiRq/8tUzLN5tgWKSU2 +GISYIvqwfJRZLEH0hLFnjMu/YyymDK/YZzFW1Sq3yCDOEoGqC39xNQu65QUEGwR7lR+ 943b1btSJZXyoe9GQAEqC8mROcCsIPG7WtPAJCA6KefWlDRbq7FIU8TpzqQIgyZtK3bP WcbuTL9QlJ7pqUmOXO5iKCaif4CwXiF6bypryCkzGoAqZobAUfqS8Jxrbb3noPM9FDEZ Og== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jrutp8hqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 20:01:21 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 28MK1KEX001846 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 20:01:20 GMT Received: from [10.110.101.161] (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.986.29; Thu, 22 Sep 2022 13:01:19 -0700 Message-ID: <39ee3606-6021-b4a8-12ec-c07b554e3b55@quicinc.com> Date: Thu, 22 Sep 2022 13:01:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [Freedreno] [PATCH v2 01/10] drm/msm: fix use-after-free on probe deferral Content-Language: en-US To: Johan Hovold , Douglas Anderson , Dmitry Baryshkov , "Rob Clark" , Abhinav Kumar CC: , Neil Armstrong , Daniel Vetter , Jonas Karlman , , Bjorn Andersson , , , Jernej Skrabec , Stephen Boyd , Robert Foss , Andrzej Hajda , Manivannan Sadhasivam , , Sean Paul , Steev Klimaszewski , Laurent Pinchart References: <20220913085320.8577-1-johan+linaro@kernel.org> <20220913085320.8577-2-johan+linaro@kernel.org> From: Kuogee Hsieh In-Reply-To: <20220913085320.8577-2-johan+linaro@kernel.org> 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: FZC-_1HAD1V0zZnWbDTOWLsb_vo_aEFb X-Proofpoint-ORIG-GUID: FZC-_1HAD1V0zZnWbDTOWLsb_vo_aEFb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-22_14,2022-09-22_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209220129 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/2022 1:53 AM, Johan Hovold wrote: > The bridge counter was never reset when tearing down the DRM device so > that stale pointers to deallocated structures would be accessed on the > next tear down (e.g. after a second late bind deferral). > > Given enough bridges and a few probe deferrals this could currently also > lead to data beyond the bridge array being corrupted. > > Fixes: d28ea556267c ("drm/msm: properly add and remove internal bridges") > Fixes: a3376e3ec81c ("drm/msm: convert to drm_bridge") > Cc: stable@vger.kernel.org # 3.12 > Reviewed-by: Dmitry Baryshkov > Signed-off-by: Johan Hovold Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh > --- > drivers/gpu/drm/msm/msm_drv.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > index 391d86b54ded..d254fe2507ec 100644 > --- a/drivers/gpu/drm/msm/msm_drv.c > +++ b/drivers/gpu/drm/msm/msm_drv.c > @@ -241,6 +241,7 @@ static int msm_drm_uninit(struct device *dev) > > for (i = 0; i < priv->num_bridges; i++) > drm_bridge_remove(priv->bridges[i]); > + priv->num_bridges = 0; > > pm_runtime_get_sync(dev); > msm_irq_uninstall(ddev);