From 617b956ac95bbec5595331ed0b6791b4d0d57745 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 8 Feb 2024 12:26:09 +0100 Subject: [PATCH] bugfix --- CHANGELOG.md | 2 ++ linux/payload/FreshSupvHandler.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2d0b21..23cea489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ will consitute of a breaking change warranting a new major release: ## Fixed +- PLOC SUPV sets: Added missing `PoolReadGuard` instantiations when reading boot status report + and latchup status report. - PLOC SUPV latchup report could not be handled previously. - Bugfix in PLOC SUPV latchup report parsing. diff --git a/linux/payload/FreshSupvHandler.cpp b/linux/payload/FreshSupvHandler.cpp index 346cd8f2..4bf89f01 100644 --- a/linux/payload/FreshSupvHandler.cpp +++ b/linux/payload/FreshSupvHandler.cpp @@ -900,7 +900,7 @@ ReturnValue_t FreshSupvHandler::parseTmPackets() { } break; } - case(Apid::LATCHUP_MON): { + case (Apid::LATCHUP_MON): { if (tmReader.getServiceId() == static_cast(supv::tm::LatchupMonId::LATCHUP_STATUS_REPORT)) { handleLatchupStatusReport(receivedData); @@ -1399,15 +1399,17 @@ ReturnValue_t FreshSupvHandler::verifyPacket(const uint8_t* start, size_t foundL ReturnValue_t FreshSupvHandler::handleBootStatusReport(const uint8_t* data) { ReturnValue_t result = returnvalue::OK; - result = verifyPacket(data, tmReader.getFullPacketLen()); - if (result == result::CRC_FAILURE) { sif::error << "PlocSupervisorHandler::handleBootStatusReport: Boot status report has invalid" " crc" << std::endl; return result; } + PoolReadGuard pg(&bootStatusReport); + if (pg.getReadResult() != returnvalue::OK) { + return pg.getReadResult(); + } const uint8_t* payloadStart = tmReader.getPayloadStart(); uint16_t offset = 0; @@ -1471,13 +1473,17 @@ ReturnValue_t FreshSupvHandler::handleLatchupStatusReport(const uint8_t* data) { ReturnValue_t result = returnvalue::OK; result = verifyPacket(data, tmReader.getFullPacketLen()); - if (result == result::CRC_FAILURE) { sif::error << "PlocSupervisorHandler::handleLatchupStatusReport: Latchup status report has " << "invalid crc" << std::endl; return result; } + PoolReadGuard pg(&latchupStatusReport); + if (pg.getReadResult() != returnvalue::OK) { + return pg.getReadResult(); + } + const uint8_t* payloadData = tmReader.getPayloadStart(); uint16_t offset = 0; latchupStatusReport.id = *(payloadData + offset); -- 2.43.0