Skip to content

Commit

Permalink
sw_services :xilplmi: Clear XPlmi_BoardParams instance in case of fai…
Browse files Browse the repository at this point in the history
…lure

In case SetBoard command fails to set the name of board, BoardName should be
cleared to zero and Len should be assigned to zero for security reasons.
This patch ensures the same.

Signed-off-by: Vikram Sreenivasa Batchali <[email protected]>
Acked-by: Mounika Akula <[email protected]>
  • Loading branch information
[email protected] authored and Siva Addepalli committed Aug 25, 2022
1 parent 50d4a73 commit ac731f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/sw_services/xilplmi/src/common/xplmi_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
* ma 07/20/2022 Print XPlmi_MaskPoll failures in all cases
* bm 07/20/2022 Retain critical data structures after In-Place PLM Update
* bm 07/24/2022 Set PlmLiveStatus during boot time
* bsv 08/23/2022 Clear BoardParams instance in case of failure
*
* </pre>
*
Expand Down Expand Up @@ -1215,6 +1216,9 @@ static u8* XPlmi_BoardNameRW(const XPlmi_Cmd *Cmd, u8 GetFlag, u32 *Len)
Status = XPlmi_DmaXfr((u64)(u32)&Cmd->Payload[0U],
(u64)(u32)BoardParams->Name, *Len, XPLMI_PMCDMA_0);
if (Status != XST_SUCCESS) {
(void)XPlmi_MemSetBytes((void *)BoardParams,
sizeof(XPlmi_BoardParams), 0U,
sizeof(XPlmi_BoardParams));
goto END;
}

Expand Down

0 comments on commit ac731f3

Please sign in to comment.