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

[libc] add cmake for hardening mode #86527

Open
nickdesaulniers opened this issue Mar 25, 2024 · 1 comment
Open

[libc] add cmake for hardening mode #86527

nickdesaulniers opened this issue Mar 25, 2024 · 1 comment
Labels
enhancement Improving things as opposed to bug fixing, e.g. new or missing feature libc

Comments

@nickdesaulniers
Copy link
Member

We'd need to think about what precisely we'd want here, but I'd like to have some configuration knob for llvm-libc, for users that want additional hardening levels applied to their build.

For example, a bunch of the syscall wrappers take pointers. If we pass these to the Linux kernel, the kernel aught to flag this. But sometimes we use/trust those pointers, and that can lead to a bad time. As an example #86169 creates a reference from these pointers without checking for nullptr.

Should that be an LIBC_ASSERT? Should someone just enable assertions for their build of llvm-libc if they're paranoid? Do we need two different configs to distinguish between potentially expensive asserts vs hardening asserts?

This is probably worth an RFC, but filing a feature request for now.

@nickdesaulniers nickdesaulniers added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature libc labels Mar 25, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 25, 2024

@llvm/issue-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

We'd need to think about what precisely we'd want here, but I'd like to have some configuration knob for llvm-libc, for users that want additional hardening levels applied to their build.

For example, a bunch of the syscall wrappers take pointers. If we pass these to the Linux kernel, the kernel aught to flag this. But sometimes we use/trust those pointers, and that can lead to a bad time. As an example #86169 creates a reference from these pointers without checking for nullptr.

Should that be an LIBC_ASSERT? Should someone just enable assertions for their build of llvm-libc if they're paranoid? Do we need two different configs to distinguish between potentially expensive asserts vs hardening asserts?

This is probably worth an RFC, but filing a feature request for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving things as opposed to bug fixing, e.g. new or missing feature libc
Projects
None yet
Development

No branches or pull requests

2 participants