liaoxin01 opened a new pull request, #71142:
URL: https://github.com/apache/doris/pull/71142

   ### Background
   
   Arrow Stream Load reads IPC messages from the load pipe and converts decoded 
record batches into Doris columns.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Bugfix
   
   Problem Summary:
   
   Malformed Arrow IPC input can reach array decoding or conversion before its 
buffer ranges and array layout are fully checked. Stream Load now rejects 
invalid ranges before decoding and checks the resulting batch before column 
conversion.
   
   ### Details
   
   - **Frequency:** Triggered by input that fails IPC buffer range or batch 
validation. Production frequency is unknown.
   - **Root cause:** The IPC stream reader can return short buffer slices, and 
the lightweight batch validator checks only the endpoints of variable-width 
offsets.
   - **Why existing tests missed it:** 
`LoadArrowPipeTest.MalformedIpcReturnsAnError` checks invalid framing. 
`test_arrow_stream_load_type_validation` checks type conversions and uses 
structurally valid IPC fixtures.
   - **Fix:** Validate record and dictionary buffer ranges against the message 
body, then fully validate decoded record batches before conversion.
   - **Other paths and branches:** The patch covers the BE Arrow Stream Load 
reader on master. Release branches were not verified.
   
   ### Testing
   
   Before rebasing, a local Arrow 24 ASAN/UBSAN smoke check passed with 
compressed and uncompressed streams, dictionary and binary arrays, and an empty 
batch. The local BE unit-test build could not link due to missing third-party 
libraries. The Doris end-to-end regression was not run.
   
   ### Release note
   
   Arrow Stream Load rejects invalid IPC buffer ranges and malformed record 
batches.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: Doris BE unit and end-to-end 
tests did not run locally.
   
   ### AI Disclosure
   
   - Tool: Codex
   - Generated: The fix, the Arrow smoke check, and the PR description.
   - Human review: The author identified the decoding path and requested IPC 
buffer validation.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to