-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[PAC][clang] Fix address discrimination for type_info vtable pointers #101716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-driver Author: Daniil Kovalev (kovdan01)
In #99726, `-fptrauth-type-info-vtable-pointer-discrimination` was introduced, which is intended to enable type and address discrimination for type_info vtable pointers.
However, some codegen logic for actually enabling address discrimination is missing. Particularly, in
Here, I was able to fix that locally by just using a dummy An existing test clang/test/CodeGenCXX/ptrauth-type-info-vtable.cpp shows such incorrect behavior. Particularly, in line 55, we have
This has constant discriminator, but does not have address discrimination, while it should be enabled with
|
@llvm/issue-subscribers-bug Author: Daniil Kovalev (kovdan01)
In #99726, `-fptrauth-type-info-vtable-pointer-discrimination` was introduced, which is intended to enable type and address discrimination for type_info vtable pointers.
However, some codegen logic for actually enabling address discrimination is missing. Particularly, in
Here, I was able to fix that locally by just using a dummy An existing test clang/test/CodeGenCXX/ptrauth-type-info-vtable.cpp shows such incorrect behavior. Particularly, in line 55, we have
This has constant discriminator, but does not have address discrimination, while it should be enabled with
|
@llvm/issue-subscribers-clang-codegen Author: Daniil Kovalev (kovdan01)
In #99726, `-fptrauth-type-info-vtable-pointer-discrimination` was introduced, which is intended to enable type and address discrimination for type_info vtable pointers.
However, some codegen logic for actually enabling address discrimination is missing. Particularly, in
Here, I was able to fix that locally by just using a dummy An existing test clang/test/CodeGenCXX/ptrauth-type-info-vtable.cpp shows such incorrect behavior. Particularly, in line 55, we have
This has constant discriminator, but does not have address discrimination, while it should be enabled with
|
In llvm#99726, `-fptrauth-type-info-vtable-pointer-discrimination` was introduced, which is intended to enable type and address discrimination for type_info vtable pointers. However, some codegen logic for actually enabling address discrimination was missing. This patch addresses the issue. Fixes llvm#101716
In #99726,
-fptrauth-type-info-vtable-pointer-discrimination
was introduced, which is intended to enable type and address discrimination for type_info vtable pointers.However, some codegen logic for actually enabling address discrimination is missing. Particularly, in
ItaniumRTTIBuilder::BuildVTablePointer
(clang/lib/CodeGen/ItaniumCXXABI.cpp), there is the following piece of code:Here,
nullptr
is used asStorageAddress
unconditionally, so, address discrimination is not actually enabled even if requested. It caused test-suite failures in several EH-related tests.I was able to fix that locally by just using a dummy
ptr inttoptr (i64 1 to ptr)
value asStorageAddress
(just like I did with init/fini, see #96478 (comment)), and tests became passing. I'm not sure how to get a properStorageAddress
here, so I've used that dummy placeholder which actually seems to do the job.An existing test clang/test/CodeGenCXX/ptrauth-type-info-vtable.cpp shows such incorrect behavior. Particularly, in line 55, we have
This has constant discriminator, but does not have address discrimination, while it should be enabled with
-fptrauth-type-info-vtable-pointer-discrimination
. The correct output should be smth like (if we use a placeholder valueptr inttoptr (i64 1 to ptr)
as storage address)The text was updated successfully, but these errors were encountered: