L. C. Hsieh created SPARK-59831:
-----------------------------------

             Summary: Validate bounds in the vectorized BYTE_STREAM_SPLIT reader
                 Key: SPARK-59831
                 URL: https://issues.apache.org/jira/browse/SPARK-59831
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 5.0.0
            Reporter: L. C. Hsieh


Follow-up of SPARK-59812. The vectorized BYTE_STREAM_SPLIT reader 
(VectorizedByteStreamSplitValuesReader, added by SPARK-56894) does not validate 
its position against the page, so a corrupt page can be decoded silently:

* The skip methods (skipIntegers, skipLongs, skipFloats, skipDoubles, 
skipBytes, skipShorts, skipBinary, skipFixedLenByteArray) only do `offset += 
total`, without checking that the page has that many values. The read paths 
index pageData without a bound check either, so reading past the end reads 
bytes from the next stream or fails with an ArrayIndexOutOfBoundsException 
instead of a ParquetDecodingException.
* initFromPage derives the value count as `totalBytes / typeWidth` and does not 
reject `totalBytes % typeWidth != 0`. For such a page, every stream starts at 
the wrong offset, so every value is silently decoded from the wrong bytes.

SPARK-56894 is in branch-4.3 and v4.3.0-rc1, so this should be fixed before 
4.3.0 is released.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to