Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1198108lqb; Thu, 30 May 2024 03:22:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMxIJnSD1rLGZeU0PHyWebVMt/MIM65qwO3EeWYjrOPkitb/YQuWXLdZUB619abvgttjcMz5TufePgqqzrlHujPGPeEcVHFfFMI384vg== X-Google-Smtp-Source: AGHT+IHTjNMJ4nudzgskuBsow39R7Rwa6yvLO2e4sFlcEN4tjYL1+eIhe2wsM8KzqmSGXjuMM4Dz X-Received: by 2002:a05:620a:460e:b0:792:b96d:370b with SMTP id af79cd13be357-794e9d9678bmr266775285a.13.1717064548116; Thu, 30 May 2024 03:22:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717064548; cv=pass; d=google.com; s=arc-20160816; b=wYra3hP27cj9kMR8zKh+kz6BrjnaUlMin8xVK7RwMFlzg4Ry3oI05mRCyjBYVlaq+f PfJhfxp/MdBCc4x5xyEqM3KKk5IGN+c90gZ7PuwSujeV2gWK+cgjbe7fhOLWCE7RiJbU MfZaG3V0w1E9LgrSvZ+z6fpRGLCQpvGu9Bc2a6dLAr78gzbw4arm0KQjWKL43q19M1TM ffOR8PbVdkc25YVW03ATw5ZojH/Fom4H9utsXIxWM28GH0WXOKuKUAIwBY6oW/296/bb 6fWaQUYAuoLPQ8Q3BTET3w3elrAD/zL0iiuePqNvEOeCSpGtRXK7OOcmKzlpr03aJDHi zpbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VZjjUE0o7FO4788n4bimmulmOT7RWu5dKDpXWyVexEU=; fh=diZmGYJcu01zmNbcPcyhEp2Q9qdQcYqGq04YRZeL26M=; b=IEBhtoXMH/HpZYkR/ucGdBaMNBlPLdup2vuCMe7Ii3P4OxPIZOkhQ3bYU7pmNTT96y 2pTziogtqt627pRrasF1GAZzfL1FNhanQwy2SR4sqGMf26Hil7aGF1HWoquBgNUkMhLO rHrFlEPP/FhgYlX1/GJ7A+FsSO2lYsk5eqXLT7NeGzdq1AGQS0U4NGoop/sObMVl7YxF aG3+7MRWDVQd8AEVcsaGj2R/QOBEUUi/ovpaUYkbTeOmIOLJlbMgNK5BYIBHVED7fBjN jrXtvYc32tt7fI0cr/IR21I1pmM2S+W0UQKv7R+qWP6x2qVaLrS2EcKIRU2ePQrPWxh2 CBFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=UaVcV0s2; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-195247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abd0aab4si1429655285a.371.2024.05.30.03.22.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 03:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=UaVcV0s2; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-195247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D61ED1C223BE for ; Thu, 30 May 2024 10:22:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68206176ACF; Thu, 30 May 2024 10:20:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="UaVcV0s2" 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 56E0217E464; Thu, 30 May 2024 10:20:56 +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=1717064457; cv=none; b=tq0cxEk09gbh0fmTnVr3pJm5WJ1pFMyXa3eAAKzvnG8krCGZt7n2JzlSp1CnyHdAzfccRex8Cjw2PI8veLSVae32wJuar0zNvT7w6WzZVEEnssifxuhuDgpPbXILC6smzG36/eskOU3KXRPAha6JEbAah06aZ4KVlzBgoqqbBxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717064457; c=relaxed/simple; bh=+zf3wOWL9nEPaWe0XMjwhv+ZASVMdKnvh2ZQOcAedzw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bXzbUS9h2j4UMdbi3AKuJIrgPFaX3lwrh67HYB4G/Wh1AM4o3RCPiqAvnrOOyyiv5POYYIQ8Pq8aceWWJSqFny7U83k2cezAKA/m9m0RgC8q9p5+bOYxQe4mIWlPsR1HCAT5/N0l0Zp+HfsOpbRy0wQ57Lqls/rtBjNbtW/O82E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=UaVcV0s2; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44U9ZSlh025134; Thu, 30 May 2024 10:20:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= VZjjUE0o7FO4788n4bimmulmOT7RWu5dKDpXWyVexEU=; b=UaVcV0s2gOTaqNgo yRXbXAzXSXxy7V1/kBsQ9zRsUxrhMZeZY118AcyNC9hfNnwrBcyx2vmRqc1XQb6j UvVIuSQoQFGSq1h0cAKavyW1zLwb9qkt4F6XIiTqyKzR9pWd4GCkzPlibQkvfghy gZNLPhJ/IAzjvfonqgOyKLYw8Z1QSWGF3tKEyZJo2s4LnhEH4WUHen4W+YvnMuMn TkkxKJmrmeB31Fot77QlSBQXtLq/d6bTsRxh42Qr0R2sBTkqvMc0n1qV4iwdbhdT RACIbcc6XjCMkgoAqXLAIpBcMRvvUks1eKJCxe/8q4AyE6KioB4+Yy8SllIjF13r C/cU6w== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yba2hbhmq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 May 2024 10:20:52 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44UAKpdr012756 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 May 2024 10:20:51 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; Thu, 30 May 2024 03:20:48 -0700 From: Ekansh Gupta To: , CC: , , , , stable Subject: [PATCH v3 3/9] misc: fastrpc: Fix memory corruption in DSP capabilities Date: Thu, 30 May 2024 15:50:21 +0530 Message-ID: <20240530102032.27179-4-quic_ekangupt@quicinc.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240530102032.27179-1-quic_ekangupt@quicinc.com> References: <20240530102032.27179-1-quic_ekangupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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-GUID: r5j9ITlkJJQju3JtRrZFP3fLq1EtWBNJ X-Proofpoint-ORIG-GUID: r5j9ITlkJJQju3JtRrZFP3fLq1EtWBNJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-30_07,2024-05-28_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 suspectscore=0 phishscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=997 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405300078 DSP capabilities request is sending bad size to utilities skel call which is resulting in memory corruption. Pass proper size to avoid the corruption. Fixes: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities") Cc: stable Signed-off-by: Ekansh Gupta --- drivers/misc/fastrpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 61389795f498..3e1ab58038ed 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1695,6 +1695,7 @@ static int fastrpc_get_info_from_dsp(struct fastrpc_user *fl, uint32_t *dsp_attr /* Capability filled in userspace */ dsp_attr_buf[0] = 0; + dsp_attr_buf_len -= 1; args[0].ptr = (u64)(uintptr_t)&dsp_attr_buf_len; args[0].length = sizeof(dsp_attr_buf_len); -- 2.43.0