Fix Clang CFI icall type mismatch in rd_list_remove_cmp and string comparators - #5557
Fix Clang CFI icall type mismatch in rd_list_remove_cmp and string comparators#5557Eric Xu (EricFXU) wants to merge 4 commits into
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
Ankith L (Ankith-Confluent)
left a comment
There was a problem hiding this comment.
Thanks for the PR Eric Xu (@EricFXU).
I've added a few comments.
Once those are addressed we can run the CI and see if anything else comes up.
|
/sem-approve |
|
Hi Eric Xu (@EricFXU) |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi Ankith L (@Ankith-Confluent), I had installed the wrong version of Also, could you please help answer when we can expect this fix to be released? |
|
/sem-approve |
|
Hey Eric Xu (@EricFXU) |
Ankith L (Ankith-Confluent)
left a comment
There was a problem hiding this comment.
Thanks for the PR Eric Xu (@EricFXU)
LGTM!
We will be merging it after another round of review.
Problem
Under Clang Control Flow Integrity (
-fsanitize=cfi-icall), function pointer signatures at indirect call sites must match the target function parameter types exactly.Passing
(void *)strcmpor comparators withoutconstparameters tord_list_remove_cmpandrd_list_findcauses Clang CFI to flag due to type mismatches betweenint (*)(void *, void *)andint (*)(const void *, const void *).Fix
rd_list_remove_cmpandrd_list_remove_multi_cmpsignatures insrc/rdlist.handsrc/rdlist.cto acceptint (*cmp)(const void *_a, const void *_b).(void *)strcmpfunction pointer casts withrd_list_cmp_strinsrc/rdkafka_metadata.c,src/rdkafka_partition.c,src/rdkafka_topic.c, andsrc/rdkafka_sasl_oauthbearer.c.