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

Link libp11-kit so that it cannot unload #383

Merged
merged 1 commit into from
Aug 24, 2021
Merged

Conversation

manu0401
Copy link
Contributor

libp11-kit installs a pthread_atfork() callback to count forks. If the
library gets unloaded, a stale pointer is called on the next fork(),
leading to a crash.

This fix adds -z nodelete linker flag so that libp11-kit cannot be
unloaded. Unfortunately, that only fixes the problem for GNU ld.
More additionnal flags will be required for other linkers.

libp11-kit installs a pthread_atfork() callback to count forks. If the
library gets unloaded, a stale pointer is called on the next fork(),
leading to a crash.

This fix adds -z nodelete linker flag so that libp11-kit cannot be
unloaded. Unfortunately, that only fixes the problem for GNU ld.
More additionnal flags will be required for other linkers.
Copy link
Member

@ueno ueno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you; that makes sense. Would you also like to add the same logic to:
https:/p11-glue/p11-kit/blob/0.24.0/p11-kit/meson.build#L55

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.004%) to 71.856% when pulling 11d9eed on manu0401:nodelete into 509c1c9 on p11-glue:master.

@manu0401
Copy link
Contributor Author

manu0401 commented Aug 24, 2021 via email

@ueno ueno merged commit e850e03 into p11-glue:master Aug 24, 2021
@ueno
Copy link
Member

ueno commented Aug 24, 2021

OK, let me try; thank you for the patch!

@ueno
Copy link
Member

ueno commented Aug 24, 2021

#384 is the follow-up for meson.

@manu0401
Copy link
Contributor Author

manu0401 commented Aug 25, 2021 via email

@ueno
Copy link
Member

ueno commented Aug 25, 2021

Sure, I've amended the comment in #384.

@ueno ueno added this to the 0.24.1 milestone Jan 17, 2022
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

Successfully merging this pull request may close these issues.

3 participants