Algunenano opened a new issue, #55479:
URL: https://github.com/apache/arrow/issues/55479
### Describe the bug, including details regarding any error messages,
version, and platform.
`WritePayload()` and `ReadPayload()` in
`cpp/src/arrow/flight/transport/grpc/serialization_internal.cc` pass a
`FlightPayload` or `internal::FlightData` to gRPC through
`reinterpret_cast<pb::FlightData*>`, and `SerializationTraits<pb::FlightData>`
in `customize_grpc.h` casts it back. The object is not a `pb::FlightData`, so
this is undefined behavior, and Clang CFI (`-fsanitize=cfi-unrelated-cast`)
rejects it.
We found this in ClickHouse, which embeds Arrow and is enabling Clang CFI in
its release builds. It reproduces on upstream `main`: built with `-flto=thin
-fwhole-program-vtables -fvisibility=hidden -fsanitize=cfi
-fno-sanitize-trap=cfi -fsanitize-recover=cfi`, `arrow-flight-test` reports one
violation per cast site, plus one in gRPC's `call_op_set.h` on the same object:
serialization_internal.cc:220:25: runtime error: control flow integrity
check for type 'arrow::flight::protocol::FlightData' failed during cast to
unrelated type
With CFI in trap mode, any Flight RPC that sends or receives `FlightData`
aborts.
### Component(s)
C++, FlightRPC
--
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]