From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 167BE389106 for ; Mon, 8 Jun 2026 06:45:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780901143; cv=none; b=fTroyvZ//vqpHzTArgZ9lcfurNGp0Mw2G9Y3UFm3o17NK4OHYeNpaMU6BcpQTmzjntBChsbs/gW/piTrdOZ4bKnBj56JQuYj/cZiBSegPesfEVE+rRmStypIsDy1pdwVkirrrG0/lR799QlGFRm8Rf9rS9WovwHLphKBrZXmXao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780901143; c=relaxed/simple; bh=diTmMO9O3QyhwzTBPeaqe2zx1/Emk7lFPPi+nRkijjw=; h=Message-ID:Date:MIME-Version:Subject:To:References:Cc:From: In-Reply-To:Content-Type; b=LWsK2FNS8vGTp2WUQclXCTKoEc5NyLxWP/pxCcNPlkG8xX+s8Xbt2L7WG75/m7ZqpU883zospbcj+o8EwlohEvDTBFu0Ob7loh0qw03rS92m1EXnZv0rCZSCA5f2RwnTWjDdwA+MWmqUk/ZyYY7qLRpb6zcLRdx0nwMc+5ruwf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FY1glRxY; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=CEhQSBri; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FY1glRxY"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="CEhQSBri" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6586Ol9C2382908 for ; Mon, 8 Jun 2026 06:45:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= MSL8eMVgQmCH7+wdnIkRquHtCibP6jzfmw6XCEBAK3U=; b=FY1glRxYMMop3k1K ogZhmECBSOUHc1vA3nB8tVX1ql4aXZ1UHJYLXfcwbuISwZvi95nnNREhrjBBn2GU PP4iUa4D74iduphnKFj+Ux+lanriVOx44DeL1Mq8TfQFplUjPnBQCT4nkayyzs9g MA2tMT3BsRMBd7ByxR0jQlVaLl+UIfRus6U6n4cUdFOdiKTGiYJ1cDGGFFoqCEoy nznxZl2zlscf0Z7NGeBnCZBP4sB+WWLHiQpnGu9DqGHumeSJhY95LcCjWgZdeknz BYAYsGCgKJtzT1lV3YfpXVMOm7qj2UnO8whEqJcN6oKs1OLYDH/49N3WGODTSfkX g4jG1g== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4em98cxukp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 08 Jun 2026 06:45:41 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-36db995d083so2821754a91.0 for ; Sun, 07 Jun 2026 23:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780901140; x=1781505940; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=MSL8eMVgQmCH7+wdnIkRquHtCibP6jzfmw6XCEBAK3U=; b=CEhQSBricuDzu/Oeg/Cfvn04UWQwXTiRkeCbgLowRVoDH3KuP9DwgoM8/odbMOfP06 dmQ9TmByqzwcWVMmOMzFEXSzR1alCXcYicIkEF912ds4jX2Cx2vcWiQI7wSiq3pPSUc6 6SGyN6dtLMItvcPM0WyhuZPZjxm91fNnVzQReovmwWRKVZdu5GcPKpuC7E2+0TgzL0JR AQxU6lmRr9IGvjjOhxHysITD71iXEoFK9C8/7V4QbRHty6yt+ROol6kGd5IecRsIbaf9 lgyKyAde93vkpyRkRlEqrYLU/wJWL1f+n9o9J4m8gUIf7/GDJ2vJrsX5IIn3GNtTRbK0 rZxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780901140; x=1781505940; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MSL8eMVgQmCH7+wdnIkRquHtCibP6jzfmw6XCEBAK3U=; b=YGzt8wBp3eMx8oWu2rZRid13Ee5NIG6N5RxN55oABRWy3/CrtB1rn4xU79r4IxF5/Z krRen5ezfdM1f2MUVAgzbm0hr2+cP7mJBqXPUDFRWGefW31Bn3UspVZo+6CMPK5Kez/z LijE5W2VzJG6u8Oqqp0AgXuwwF6NGJEqbkF3LpktSOtX6WVeHeObNhoNj/AIgUlWyCEf V7Wqy1cn4YhUTusz01/It3mkUI0aWn5GiRw73fKpVp4NqxdAxWti5tmRfVfg9ILwXKmt 7P6phHSX8HHzyRqooPHraO9COf8n9GqJVakD8Y4ldPeEeqLdTNBRzku1PJBYVlGEyz0n m51w== X-Forwarded-Encrypted: i=1; AFNElJ8RfjCC+uH3AeaIM0INfswB+ZeqYneGfygsZSWBLpgKxnjPfmF2JeKhqtdglIrYc8lhdGgOGAwKCzMSlhQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyeP+hWhyCeArc8urEQoxhRWerDutJVPW8TDvlVIJqqX+leRPwo QROrjmogSKVtR0+aW/xfW0veT7EJNlOYqjdFnGI8x4nBuJp1ovx5+TVcF4Q1eA2+okNUt445AKS L0K1Nmac4Zmm8PU9P00sCRDxoFvprSKXk8O/y4CvXrB6ixBkp6KUA01udpP6kfx5mplE= X-Gm-Gg: Acq92OE8z3udgcfzY6E0m75MrrFZB3GH0n2yX/hnU2xRNjCqotuF0l1cYlXUDDaQCu0 kqPZw0Fm83dOOMMAjpM2j5YCUsDqW9toeEBCPW+WQASxfuJopwbQdX2QQDLwNOmQ5LxrSPRJeJb jPqFQjcWkGL4r8VE3HvbuFZslffeVplx/WbGOGbQjOPf+K35OBIjLcjKJvC9RzsgzRy7hi2SFwR RGYVW8QA8QulHuIMJuAx300hXncW32ikAW3T2ghpYfHOb8EkQQJl41ZYaJkYs31+xagom6NlLSQ XC7R/rXENj8XL2ju+fioUS6goAf4H5yYvQzK/n8HnwUMt8MFKg4vt9PYlkhvq2GQWUT3SJxlHUo 3vprfoqIHzUEv3+NqVw/NuO31ebxi7drXbKYwWgWC/biTxA6KGWp+yzL0La2q6fBnp6ucuBWnzJ L0zSiDqVFMoO+S/q3mCnBEMA9Bx1Y= X-Received: by 2002:a17:90b:48ce:b0:367:b819:2214 with SMTP id 98e67ed59e1d1-370f076d7e4mr16889779a91.13.1780901140475; Sun, 07 Jun 2026 23:45:40 -0700 (PDT) X-Received: by 2002:a17:90b:48ce:b0:367:b819:2214 with SMTP id 98e67ed59e1d1-370f076d7e4mr16889748a91.13.1780901140012; Sun, 07 Jun 2026 23:45:40 -0700 (PDT) Received: from [10.133.33.209] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36f6dba8573sm18435796a91.14.2026.06.07.23.45.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Jun 2026 23:45:39 -0700 (PDT) Message-ID: <671f75e3-888c-40ee-9365-1c41f72e008f@oss.qualcomm.com> Date: Mon, 8 Jun 2026 14:45:33 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 3/5] misc: fastrpc: Fail Audio PD init when reserved memory is missing To: Dmitry Baryshkov References: <20260602071750.526-1-jianping.li@oss.qualcomm.com> <20260602071750.526-4-jianping.li@oss.qualcomm.com> Content-Language: en-US Cc: srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, Greg KH , abelvesa@kernel.org, jorge.ramirez@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ekansh Gupta , quic_chennak@quicinc.com, stable@kernel.org From: Jianping Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA4MDA2MCBTYWx0ZWRfXyUUDoyLKdGwC EybOKVx+uQAxku0bL3i5h13IWSUTKLNQQQ4qdMF7PqSHNFVCKRGYpgbD2h2HvDxk8t/CZWKwvEO rT+M9/KZFQpNN+awBaob24T1Cd31XTR8pqg6wBxeHVmzeFbJTuRCL1YkXB+vhCexT5cEa3IXfkk PhztLmVV07zkLIqP4ylrTsajLeSGiCfNRvVkhoJL0H6rEtbopLG6blJ2kHgjJFt+FYNx5nPeg+D hyT6XPpOtfrv+XfiSs6FXsNzLsH9C4Tp3AsuLpnc8eslCdn6CnjdIy8tTE3KfvWf0+lLgi+C8hq 0cYs0Eg8VncCoB7EJMEpv1KG1tPxgCRh6gkSoLQ+/jiMqAl6eV0kVJ6DOkBiTq8S72fKJ0qCVsY s/L4qNHW1L6U49TBMwkBGAGno/3Q5ObdXkS6fwWYbSxY/1PtTnIj4F114VDHgkLHPpC/Q/57rmY Y6qwkPJj1d4KLyd6x4Q== X-Proofpoint-ORIG-GUID: wePJ-ZApHaAksmchFC0MpNKiHFW8bVqF X-Proofpoint-GUID: wePJ-ZApHaAksmchFC0MpNKiHFW8bVqF X-Authority-Analysis: v=2.4 cv=A/pc+aWG c=1 sm=1 tr=0 ts=6a266515 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=ZwHI9cLKf8hZ7ncMh4sA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-08_02,2026-06-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 priorityscore=1501 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606080060 On 6/8/2026 2:37 PM, Dmitry Baryshkov wrote: > On Mon, Jun 08, 2026 at 02:29:13PM +0800, Jianping Li wrote: >> On 6/8/2026 2:11 PM, Dmitry Baryshkov wrote: >>> On Tue, Jun 02, 2026 at 03:17:48PM +0800, Jianping Li wrote: >>>> Audio PD static process creation assumes that a reserved-memory >>>> region is defined in DT and exposed via cctx->remote_heap. >>>> >>>> If reserved-memory is missing or incomplete, the driver may pass >>>> invalid address/size information to the DSP, leading to undefined >>>> behavior or crashes. >>>> >>>> Add explicit validation for remote_heap presence and size before >>>> sending the memory to DSP, and fail early if the configuration is >>>> invalid. >>>> >>>> Fixes: 0871561055e66 ("misc: fastrpc: Add support for audiopd") >>>> Cc: stable@kernel.org >>>> Signed-off-by: Jianping Li >>>> --- >>>> drivers/misc/fastrpc.c | 7 +++++++ >>>> 1 file changed, 7 insertions(+) >>>> >>>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c >>>> index a8a58f889d07..f46a8f53970d 100644 >>>> --- a/drivers/misc/fastrpc.c >>>> +++ b/drivers/misc/fastrpc.c >>>> @@ -1354,6 +1354,13 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, >>>> } inbuf; >>>> u32 sc; >>>> + if (!fl->cctx->remote_heap || >>>> + !fl->cctx->remote_heap->dma_addr || >>>> + !fl->cctx->remote_heap->size) { >>>> + err = -ENOMEM; >>>> + dev_dbg(fl->sctx->dev, "remote heap memory region is not added\n"); >>>> + return err; >>>> + } >>> Won't this check without the next commit break the kernel? I don't see >>> where else the remote heap is being allocated. >> Yes, this check depends on remote_heap being populated during rpmsg >> probe from the reserved-memory region, introduced in a subsequent >> patch in this series. >> >> If there is no dependency on the next series, the remote_heap allocation here after the if check. >> The logic will be wrong. > So, at least you need to squash those two together. ACK. I'll squash those two patches together in the next revision. > >>>> args = kzalloc_objs(*args, FASTRPC_CREATE_STATIC_PROCESS_NARGS); >>>> if (!args) >>>> return -ENOMEM; >>>> -- >>>> 2.43.0 >>>>