diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0f5f593..9bd9a7f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,4 +2,4 @@ # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. -* @rdkcentral/advsecurity-maintainers +* @rdkcentral/psm-maintainers @rdkcentral/rdkb-maintainers diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 0550479..c58b1b0 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -1,13 +1,20 @@ name: "CLA" + +permissions: + contents: read + pull-requests: write + actions: write + statuses: write + on: issue_comment: types: [created] pull_request_target: - types: [opened,closed,synchronize] + types: [opened, closed, synchronize] jobs: CLA-Lite: name: "Signature" - uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@main + uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1 secrets: - PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }} \ No newline at end of file + PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }} diff --git a/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml b/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml index da02b8b..7b8c1cb 100644 --- a/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml +++ b/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml @@ -1,11 +1,18 @@ name: Fossid Stateless Diff Scan -on: pull_request +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: read jobs: call-fossid-workflow: - uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@develop - secrets: + if: ${{ ! github.event.pull_request.head.repo.fork }} + uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@1.0.0 + secrets: FOSSID_CONTAINER_USERNAME: ${{ secrets.FOSSID_CONTAINER_USERNAME }} FOSSID_CONTAINER_PASSWORD: ${{ secrets.FOSSID_CONTAINER_PASSWORD }} FOSSID_HOST_USERNAME: ${{ secrets.FOSSID_HOST_USERNAME }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 3776963..3e7ed0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [2.0.0](https://github.com/rdkcentral/persistent-storage-manager/compare/1.0.1...2.0.0) + +- RDKB-61951 coverity issues in ccsp-psm [`#16`](https://github.com/rdkcentral/persistent-storage-manager/pull/16) +- Update CODEOWNERS [`#14`](https://github.com/rdkcentral/persistent-storage-manager/pull/14) +- Deploy fossid_integration_stateless_diffscan_target_repo action [`#13`](https://github.com/rdkcentral/persistent-storage-manager/pull/13) +- Update CODEOWNERS [`#11`](https://github.com/rdkcentral/persistent-storage-manager/pull/11) +- Deploy cla action [`#12`](https://github.com/rdkcentral/persistent-storage-manager/pull/12) +- Merge tag '1.0.1' into develop [`b3e5be3`](https://github.com/rdkcentral/persistent-storage-manager/commit/b3e5be37138153717e4792b157aab10067596544) + #### [1.0.1](https://github.com/rdkcentral/persistent-storage-manager/compare/1.0.0...1.0.1) +> 22 August 2025 + - RDKCOM-5405: RDKBDEV-3260 Not possible to set a long variable on psmcli 2 times [`#6`](https://github.com/rdkcentral/persistent-storage-manager/pull/6) - Update run_ut.sh [`#4`](https://github.com/rdkcentral/persistent-storage-manager/pull/4) - Update psm_sysro_operation_test.cpp [`ed25e71`](https://github.com/rdkcentral/persistent-storage-manager/commit/ed25e71e9f248536917a10fde348a159ccdcc4c7) +- Add changelog for release [`2401895`](https://github.com/rdkcentral/persistent-storage-manager/commit/2401895ad69392cbf1b8e58b238a6974dbc40b9c) - Update psm_sysro_operation_test.cpp [`9b7be45`](https://github.com/rdkcentral/persistent-storage-manager/commit/9b7be45995f6ac46f6e99ea7ddeba56f5cb5e704) -- Update psm_sysro_operation_test.cpp [`6f5ca30`](https://github.com/rdkcentral/persistent-storage-manager/commit/6f5ca30881501a0b5b15de410630e9197dd1398c) #### 1.0.0 diff --git a/source/PsmSysRegistry/psm_sysro_operation.c b/source/PsmSysRegistry/psm_sysro_operation.c index b976a8a..ae23966 100644 --- a/source/PsmSysRegistry/psm_sysro_operation.c +++ b/source/PsmSysRegistry/psm_sysro_operation.c @@ -273,36 +273,38 @@ PsmSysroRegTimerInvoke PPSM_FILE_LOADER_OBJECT pPsmFileLoader = (PPSM_FILE_LOADER_OBJECT )pMyObject->hPsmFileLoader; PSYS_IRA_INTERFACE pSysIraIf = (PSYS_IRA_INTERFACE )pPsmFileLoader->hSysIraIf; + // Fix for CID 559737: Guard the modification of bNeedFlush and the read used to decide whether to modify bNeedFlush with the same set of locks. + // Ensuring that both read and write of bNeedFlush are protected by the AccessLock to avoid thread race conditions. + + AnscAcquireLock(&pMyObject->AccessLock); // Acquiring the lock before reading or modifying shared data + if ( !pMyObject->bNeedFlush ) { + AnscReleaseLock(&pMyObject->AccessLock); return ANSC_STATUS_SUCCESS; } else if ( (AnscGetTickInSeconds() - pMyObject->LastRegWriteAt) < PSM_SYSRO_REG_FLUSH_DELAY ) { + AnscReleaseLock(&pMyObject->AccessLock); return ANSC_STATUS_SUCCESS; } -// CcspTraceInfo(("\n##PsmSysRegistry.RegTimerInvoke() begins##\n")); - - AnscAcquireLock(&pMyObject->AccessLock); pSysIraIf->AcqThreadLock(pSysIraIf->hOwnerContext); if ( pMyObject->FileSyncRefCount > 0 ) { returnStatus = ANSC_STATUS_SUCCESS; - - goto EXIT1; + goto EXIT1; } pMyObject->bSaveInProgress = TRUE; returnStatus = pPsmFileLoader->SaveRegFile((ANSC_HANDLE)pPsmFileLoader); - pMyObject->bNeedFlush = FALSE; + pMyObject->bNeedFlush = FALSE; // Fix for CID 559737: Ensure this is done within the locked region pMyObject->bSaveInProgress = FALSE; pMyObject->LastRegFlushAt = AnscGetTickInSeconds(); - /****************************************************************** GRACEFUL ROLLBACK PROCEDURES AND EXIT DOORS ******************************************************************/ @@ -310,9 +312,9 @@ PsmSysroRegTimerInvoke EXIT1: pSysIraIf->RelThreadLock(pSysIraIf->hOwnerContext); - AnscReleaseLock(&pMyObject->AccessLock); + AnscReleaseLock(&pMyObject->AccessLock); -// CcspTraceInfo(("\n##PsmSysRegistry.RegTimerInvoke() ends##\n")); - - return returnStatus; + return returnStatus; } + + diff --git a/source/Ssp/ssp_dbus.c b/source/Ssp/ssp_dbus.c index 5e18e48..674a79f 100644 --- a/source/Ssp/ssp_dbus.c +++ b/source/Ssp/ssp_dbus.c @@ -732,6 +732,7 @@ int getParameterValues( if(pParameterValue != NULL) { AnscFreeMemory(pParameterValue); + pParameterValue = NULL; // CID 151687: Set the pointer to NULL after freeing to avoid double free } ret = CCSP_FAILURE; goto EXIT; @@ -799,7 +800,11 @@ int getParameterValues( else { AnscFreeMemory(pParameterValue->val); - AnscFreeMemory(pParameterValue); + if (pParameterValue != NULL) + { + AnscFreeMemory(pParameterValue); // CID 151687:Second free (this won't be called if pParameterValue is already freed) + pParameterValue = NULL; // Set to NULL after freeing + } } } else