Skip to content

Commit 641f6fd

Browse files
mukeshojha-linuxandersson
authored andcommitted
soc: qcom: pd-mapper: Fix element length in servreg_loc_pfr_req_ei
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 >= Max Len 65 Fix this by matching with servreg_loc_pfr_req's reason field. Fixes: 1ebcde0 ("soc: qcom: add pd-mapper implementation") Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Tested-by: Nikita Travkin <nikita@trvn.ru> Link: https://lore.kernel.org/r/20260129152320.3658053-2-mukesh.ojha@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 6de23f8 commit 641f6fd

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/soc/qcom/pdr_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct servreg_set_ack_resp {
8484

8585
struct servreg_loc_pfr_req {
8686
char service[SERVREG_NAME_LENGTH + 1];
87-
char reason[257];
87+
char reason[SERVREG_PFR_LENGTH + 1];
8888
};
8989

9090
struct servreg_loc_pfr_resp {

drivers/soc/qcom/qcom_pdr_msg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ const struct qmi_elem_info servreg_loc_pfr_req_ei[] = {
325325
},
326326
{
327327
.data_type = QMI_STRING,
328-
.elem_len = SERVREG_NAME_LENGTH + 1,
328+
.elem_len = SERVREG_PFR_LENGTH + 1,
329329
.elem_size = sizeof(char),
330330
.array_type = VAR_LEN_ARRAY,
331331
.tlv_type = 0x02,

include/linux/soc/qcom/pdr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <linux/soc/qcom/qmi.h>
66

77
#define SERVREG_NAME_LENGTH 64
8+
#define SERVREG_PFR_LENGTH 256
89

910
struct pdr_service;
1011
struct pdr_handle;

0 commit comments

Comments
 (0)