Skip to content
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

Function pointer implicitly convertible to any capability type in hybrid #719

Open
kevin-brodsky-arm opened this issue Sep 11, 2023 · 1 comment

Comments

@kevin-brodsky-arm
Copy link

Somehow, it seems that function pointers are implicitly convertible to any capability type in hybrid C:

int * __capability g(void)
{
    return g;
}

This yields no warning at all.

@arichardson
Copy link
Member

If I recall correctly the silent conversion is a historical artifact of it being required in the CheriBSD hybrid kernel many years ago. However, also implicitly change the type rather than just the capability-ness is clearly a bug.

We should probably also remove the implicit conversion from function ptr -> function cap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants