From 5dd8eaa5ba964075760e7cbf6594206730d3b8fc Mon Sep 17 00:00:00 2001 From: xuyong Date: Sat, 20 May 2023 14:17:02 +0800 Subject: [PATCH] fixed 994821c from https://gitee.com/honghecun/kernel_linux_5.10/pulls/856 hisysevent: add pack to struct which would be serilized into raw data ohos inclusion category:bugfix issue:#I76UUQ CVE: NA Signed-off-by: xuyong --- drivers/staging/hisysevent/hisysevent_builder.h | 4 ++++ drivers/staging/hisysevent/hisysevent_raw_data_encoder.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/staging/hisysevent/hisysevent_builder.h b/drivers/staging/hisysevent/hisysevent_builder.h index 7f90db1fb19f..6570b8499847 100644 --- a/drivers/staging/hisysevent/hisysevent_builder.h +++ b/drivers/staging/hisysevent/hisysevent_builder.h @@ -17,6 +17,8 @@ #define MAX_DOMAIN_LENGTH 16 #define MAX_EVENT_NAME_LENGTH 32 +#pragma pack(1) + struct hisysevent_header { /* event domain */ char domain[MAX_DOMAIN_LENGTH + 1]; @@ -49,6 +51,8 @@ struct hisysevent_header { u8 is_open_trace: 1; }; +#pragma pack() + struct hisysevent_params { /* total count of parameters */ s32 total_cnt; diff --git a/drivers/staging/hisysevent/hisysevent_raw_data_encoder.c b/drivers/staging/hisysevent/hisysevent_raw_data_encoder.c index 9ccc928962e6..a206950aa162 100644 --- a/drivers/staging/hisysevent/hisysevent_raw_data_encoder.c +++ b/drivers/staging/hisysevent/hisysevent_raw_data_encoder.c @@ -32,6 +32,8 @@ enum hisysevent_encode_type { LENGTH_DELIMITED = 1, }; +#pragma pack(1) + struct param_value_type { /* array flag */ u8 is_array: 1; @@ -43,6 +45,8 @@ struct param_value_type { u8 value_byte_cnt: 3; }; +#pragma pack() + static u8 encode_tag(u8 type) { return type << (TAG_BYTE_OFFSET + 1); -- Gitee