Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10979

DSS: rxBuffer range check missing in DP_mailbox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • PDK
    • PDK-12243
    • -
    • PROCESSOR_SDK_08.04.00
    • PROCESSOR_SDK_09.00.00
    • Hide
      j721e-evm
      j721s2-evm
      j784s4-evm
      Show
      j721e-evm j721s2-evm j784s4-evm

      Issue Description:

      DP receives messages from sink module in messageReceive API in the file packages\ti\drv\dss\src\csl\dp\src\dp_mailbox.c. The size of this array is fixed to 1Kbytes. But sometimes, sink node sends message of size more than 1K bytes and this corrupts the memory in below code. The max buffer size must be checked here and should not read messages beyond 1K bytes.

          messageSize = (uint16_t)(((uint16_t)pD->rxBuffer[2] << 8) |
                                   (uint16_t)pD->rxBuffer[3]);
          messageSize += DP_MAILBOX_HEADER_SIZE;

          /* read message */
          while (i < messageSize)
          {
              mailboxEmpty = CPS_REG_READ(&regBase->mhdp_apb_regs.MAILBOX_EMPTY_ADDR_p);

              /* test if mailbox is not empty */
              if (0U == mailboxEmpty)
             

      {             readVal = CPS_REG_READ(&regBase->mhdp_apb_regs.mailbox0_rd_data_p);             pD->rxBuffer[i] = (uint8_t)(readVal & 0x000000FFU);             i++;         }

          }

      Resolution Description:

      Added driver check for rxBuffer overflow.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: