From patchwork Thu Jun 27 06:05:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ekansh Gupta X-Patchwork-Id: 13713895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97BB6C2BD09 for ; Thu, 27 Jun 2024 07:14:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADF5A10EA3C; Thu, 27 Jun 2024 07:14:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.b="E6KMmUlo"; dkim-atps=neutral Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4857510EA15 for ; Thu, 27 Jun 2024 06:05:50 +0000 (UTC) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45R1AYKo019664; Thu, 27 Jun 2024 06:05:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=qds3p3qHA6+WZ2ajsEavoH +smW6BoQfK9ybky+7OLzc=; b=E6KMmUlofO4BhDjFW/zDi9dcIzPwXL7lYaDlox GQP8wfEUzhVqdkm9CGRwDlfwBhZCv+gYDINBDDY5nMeisHjVlNd28c2lm0xpqUIU IR1A+RErZiDcmVcAZuU+tAZGexJ8zDflNOlHCAfWkcFSRr5OOeulxNK/oOUlCG1H FrvjsxInDfxKOyLs2ebBpP9djsfXDig7xfRp/1RGDNKGjXA626TcNo6NWMa86CL2 PFW5X9uEUkQEOA9Qu6kH0owqIiDGZY/wbbDxG64p9MGubkAM+LHexwO91VFPX7RD Q+pQ+1nEs+IkhZz9BQZUhugLQghsczbcVyDYLTXTUDWz3tmg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 400f90jn0y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 06:05:43 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45R65gjg020397 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 06:05:42 GMT Received: from hu-ekangupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 26 Jun 2024 23:05:26 -0700 From: Ekansh Gupta To: , CC: , , , , , , stable Subject: [PATCH v2] misc: fastrpc: Remove user PD initmem size check Date: Thu, 27 Jun 2024 11:35:18 +0530 Message-ID: <20240627060518.1510124-1-quic_ekangupt@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: BSCAxBFTNYK2lMSxuttyccRj2S0dM9uL X-Proofpoint-GUID: BSCAxBFTNYK2lMSxuttyccRj2S0dM9uL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-27_02,2024-06-25_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 suspectscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406270044 X-Mailman-Approved-At: Thu, 27 Jun 2024 07:14:37 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For user PD initialization, initmem is allocated and sent to DSP for initial memory requirements like shell loading. This size is passed by user space and is checked against a max size. For unsigned PD offloading, more than 2MB size could be passed by user which would result in PD initialization failure. Remove the user PD initmem size check and allow buffer allocation for user passed size. Any additional memory sent to DSP during PD init is used as the PD heap. Fixes: 7f1f481263c3 ("misc: fastrpc: check before loading process to the DSP") Cc: stable Signed-off-by: Ekansh Gupta --- Changes in v2: - Modified commit text. - Removed size check instead of updating max file size. drivers/misc/fastrpc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 5204fda51da3..9d064deeac89 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1389,11 +1389,6 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl, goto err; } - if (init.filelen > INIT_FILELEN_MAX) { - err = -EINVAL; - goto err; - } - inbuf.pgid = fl->tgid; inbuf.namelen = strlen(current->comm) + 1; inbuf.filelen = init.filelen;