From nobody Mon Apr 13 05:44:23 2026 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 D0DF4374176 for ; Mon, 9 Mar 2026 09:01:59 +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=1773046921; cv=none; b=HX6IJyf2hr0xbJ4hKB5ggayDB4lLPbR2tbKN4r4g66KLA/thVwQv/0ltTvMvSLK0VKgliMQxM3gSebh+mnyqTJpccsANXfhoPaC/jzBJ7QhMHRMQwqAiTsIvWWjIxRByxhXZw2TJhbKoN/oiyGIGNBs+ZdFWOpFEKylg64dq48o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773046921; c=relaxed/simple; bh=Dg8zrA6CUods8o4GrDVZcKD1y+aUliP9q3308zWT0yI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lLRuBOeYb7d+zgYo56dva8lr0PfTXocKxDoQAjgT/avyfW1Prwd0aWHoxp8DxqKIIc607E2QMBZmLMOj/veC7WK4EVQrb/PdoVmxaVm7Uyyc/1ZPSDVFABnlmoaxVncwYc58JBr3CsXAWskSVaDJd/EI4gHts/FcUYWcgjWKnIU= 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=QzzV8Aqf; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Us9O/aSU; 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="QzzV8Aqf"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Us9O/aSU" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6293nUOX931462 for ; Mon, 9 Mar 2026 09:01:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=Hd0u74ruSn6uVMlMdsGn8P4cicEn+NcTzo5 0tkBlkiQ=; b=QzzV8Aqf3/BfpVkIcjKaLnyQ1icNDC09UnqbkX4pYZYTghv3Jf8 ujnxu+uK1R0AZBMfd2Gus7GdQzJDXmAmT/nWdZLVUziNgfgZ+ZBJpLjX0Ifxz4fw JqoRkFDznKamxJnNzNfkQIbCycHZb8jy+DqlJGuiV6g7DJ9YmiouQSciZC05zU5m Bl9upAcnvdVcPhAjy4ORBpfwF7GMBGv4j48E3fN6/kLeIX8NvAwADqOV0J3tVwXf pED/Yb5g50CZfoOTNxSDSr8bCZcrJw39/DRrXvFjaVsyDq3sUOKWTeUrYYnvRz98 aPXK9k2kAGsKYJKm2fSfmVe2vUjJrp9pWHg== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4crc83cnnh-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Mar 2026 09:01:59 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-829ad8a2896so7290915b3a.0 for ; Mon, 09 Mar 2026 02:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773046918; x=1773651718; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Hd0u74ruSn6uVMlMdsGn8P4cicEn+NcTzo50tkBlkiQ=; b=Us9O/aSUWLQDCWB0uE9fDIbNH0G/jGkqNHj+6WORqkn0vgp2jEY1WevKGJ7gVfu5yy NFS6TQCgSK0k4iK9QfaPyWJKETMAzHkWLabuFe2XCFX+5YxbL8hofI7bb9s/FlRYM4wW OQPHZWuKnnFVoAHijXId0KlCTdpqSgB0yPHXo2FWD16XTVTkFwRF0QPDdFWftHyAO3TW me3/pvrJ2h5tMS9ba3XH7z6PQZxndRCAChE0rdZ4/RYpM6PW2YI7aPIKZhieezNRaTbY 9P+bDlQydiHQJ+Iw/1fpjG0Hma7uhk1Zg6IsLJFk8juQEk+HJ64wIUXYpQY9tP/v4Zi9 jwTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773046918; x=1773651718; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Hd0u74ruSn6uVMlMdsGn8P4cicEn+NcTzo50tkBlkiQ=; b=fEbhLeIJo0Ef0vdVRfgslGO3asgOAZnIDD6x/ic7osZNYEE4LqdTDwPWnPiy/dHa60 ux0Rm/ZwnO02nE+PxdFL8G+zAQYZ52FOtbK+XlVRDGV4aJdB/E20SWgQwCdzmkcb9l/t NUvsv2gwtrY1DWCcDm4rKKtAnlhTiTGng35KGpocUb3AqsHu2O+1jj1C4He4CtyyriMC 3qV7Z6jh7E4cPCwSGbkpKFsm1G82+Lxdg+n79/llGskiSqv2ioIuS5xH2p0dsFr7xvsL p32INOc2GvOGli6MbMIJ6qzYe+WdMgwB9s8TpPrtkalxw6jqz3ttu0f346+FuQAFuUQT Pwrw== X-Forwarded-Encrypted: i=1; AJvYcCU77Lb/mvkSv/eYgQ3/ut7lIxplH3YEsMV+YWIAb3OLHesKTLHOUeSfTyG6+THY6lx1EqCsJaJcZSiHqkc=@vger.kernel.org X-Gm-Message-State: AOJu0YxrGY2SCTiHiJmI2UJp+PdDGGEHhFyiw+B9HoNlepZT6ddpwGYN go26cByngZWyjfku1r1TN+/vj17mIpf81fexiA949GamI6KdNUb9ze8e06CH0ReRbQCuLR8yti3 UXC3L6BxEV5IZtBppUby4S5eY81jYugTtN2qMSNdMvkksjOZMHvmAGsLAK/591G8j8KI= X-Gm-Gg: ATEYQzwbVpSE3zNycLHVmy4z4NLejllZXKbWseEapPoS94ta3OHAW4ait8q13EEQmgE JFRt0442qqAU4KWLgtDSU6OGFlj/5pNhjWPnVIVIj1wLDFyNshnbfcSU7kRph5zefgeap1AzyXM TStEw8HDi2bETKINxwfpq6sdPgVhk5n+5W6bX/e8bVJ1pnQzQodWXjKW132EfDjJwbKAz/GmFfb gUTYE13ofj/L/mmGOcasck2mLKQzs7Qv4+cRvmfGojiB2Gp4aGI2Tv3nJeo3v7hNJFpDn21XUhb XqRs/PkrtQPu1gZgiejS6Ap8UGIAY8nYpX5t/zljZFw5vvZHRJlOJKKBbliA8X4QVlaAYCVCKyp y+uDkjsb0ZDtMYrZizt2O6yoZsBjhB8l+YohP6iIpDw/9d17L X-Received: by 2002:a05:6a00:2e99:b0:81f:3cd5:206e with SMTP id d2e1a72fcca58-829a2dd7258mr9294065b3a.1.1773046918406; Mon, 09 Mar 2026 02:01:58 -0700 (PDT) X-Received: by 2002:a05:6a00:2e99:b0:81f:3cd5:206e with SMTP id d2e1a72fcca58-829a2dd7258mr9294016b3a.1.1773046917738; Mon, 09 Mar 2026 02:01:57 -0700 (PDT) Received: from hu-mojha-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a48d372esm9698087b3a.61.2026.03.09.02.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 02:01:57 -0700 (PDT) From: Mukesh Ojha To: Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Chris Lew Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Gokul Krishnakumar , stable@vger.kernel.org, Dmitry Baryshkov , Mukesh Ojha Subject: [PATCH v3] soc: qcom: pd-mapper: Fix element length in servreg_loc_pfr_req_ei Date: Mon, 9 Mar 2026 14:31:50 +0530 Message-ID: <20260309090151.897685-1-mukesh.ojha@oss.qualcomm.com> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=R9UO2NRX c=1 sm=1 tr=0 ts=69ae8c87 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=2cWN1nsCyI40IQ2q-vwA:9 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA5MDA4MiBTYWx0ZWRfX4/AjaCWQfNcT mDE8SvaxADq5ywG3I58AWKug+9j1lYtXCr5V+xnNR9pOHEH2ZsA7c8OuQCzEdNHbQnP6HgCBy2s XlYtLJLrJSI5VaytM0OcrpGffSXvY0G08ZcJ6Uzd+bjXL97J30H70lXOy38IpYKn0se/OsYt0iz 2wML91SR90UInpuhyIaMXs+5amfaiHETRiLZKJbcVpMqiN28o3gKCL+tjsQcUhYZxXzw8dQFbOK KEhbMciRusVd+bWqoeRYizk5PfzfQUPnRXiDBs5St+Aj7Dxj4KZgwuyyDRlkAD/bOUsst0f9UVl ejNai2j2tS8R87qD7ilDoiFi8LT/jImpRrwQnHXLGQOgJu6nnKzM0Rsq+hXqzgN27dHy1kDTNov qfJe97FaqFXIT0zJCGuDMorTwFMrXc5Eg/GyfJirGdQupCozco3y9HhSuBE5Hrw++ue+hYzHEud btf9+idDDmF6chZGkJA== X-Proofpoint-ORIG-GUID: 5ROymzpscxR0xQtxxm-WNtrTuLmh_EjD X-Proofpoint-GUID: 5ROymzpscxR0xQtxxm-WNtrTuLmh_EjD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-09_03,2026-03-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 spamscore=0 malwarescore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603090082 Content-Type: text/plain; charset="utf-8" From: Gokul Krishnakumar It looks element length declared in servreg_loc_pfr_req_ei for reason not matching servreg_loc_pfr_req's reason field due which we could observe decoding error on PD crash. qmi_decode_string_elem: String len 81 >=3D Max Len 65 Fix this by matching with servreg_loc_pfr_req's reason field. Cc: stable@vger.kernel.org Fixes: 1ebcde047c54 ("soc: qcom: add pd-mapper implementation") Reviewed-by: Dmitry Baryshkov Signed-off-by: Gokul Krishnakumar [mukesh: the element length change to the service field is not required. Fixed it by removing the change and rephrasing the commit text.] Signed-off-by: Mukesh Ojha Tested-by: Nikita Travkin --- Changes in v3: https://lore.kernel.org/lkml/20260202103641.3003867-1-mukesh= .ojha@oss.qualcomm.com/ - Remove debug patch as we have enough prints to make decode error code. - Added Gokul as the author of the patch and added the information on the=20 changes done by me on top. Changes in v2: https://lore.kernel.org/lkml/20260129152320.3658053-1-mukesh= .ojha@oss.qualcomm.com/=20 - Given credit to my colleague Gokul.K who first faced this issue and giv= en initial fix and that was later corrected by me. - Rebased it on next-20260130 and added stable mailing list, R-b tag. drivers/soc/qcom/pdr_internal.h | 2 +- drivers/soc/qcom/qcom_pdr_msg.c | 2 +- include/linux/soc/qcom/pdr.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/pdr_internal.h b/drivers/soc/qcom/pdr_interna= l.h index 039508c1bbf7..047c0160b617 100644 --- a/drivers/soc/qcom/pdr_internal.h +++ b/drivers/soc/qcom/pdr_internal.h @@ -84,7 +84,7 @@ struct servreg_set_ack_resp { =20 struct servreg_loc_pfr_req { char service[SERVREG_NAME_LENGTH + 1]; - char reason[257]; + char reason[SERVREG_PFR_LENGTH + 1]; }; =20 struct servreg_loc_pfr_resp { diff --git a/drivers/soc/qcom/qcom_pdr_msg.c b/drivers/soc/qcom/qcom_pdr_ms= g.c index ca98932140d8..02022b11ecf0 100644 --- a/drivers/soc/qcom/qcom_pdr_msg.c +++ b/drivers/soc/qcom/qcom_pdr_msg.c @@ -325,7 +325,7 @@ const struct qmi_elem_info servreg_loc_pfr_req_ei[] =3D= { }, { .data_type =3D QMI_STRING, - .elem_len =3D SERVREG_NAME_LENGTH + 1, + .elem_len =3D SERVREG_PFR_LENGTH + 1, .elem_size =3D sizeof(char), .array_type =3D VAR_LEN_ARRAY, .tlv_type =3D 0x02, diff --git a/include/linux/soc/qcom/pdr.h b/include/linux/soc/qcom/pdr.h index 83a8ea612e69..2b7691e47c2a 100644 --- a/include/linux/soc/qcom/pdr.h +++ b/include/linux/soc/qcom/pdr.h @@ -5,6 +5,7 @@ #include =20 #define SERVREG_NAME_LENGTH 64 +#define SERVREG_PFR_LENGTH 256 =20 struct pdr_service; struct pdr_handle; --=20 2.50.1