-
Notifications
You must be signed in to change notification settings - Fork 178
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
BUG: fix aliasing UB in scmp_bpf_sim #433
Conversation
See seccomp#425. Punning sys_data_b between uint32_t* and struct* seccomp_data isn't legal, use memcpy to fix the testsuite with Clang 17. Modern compilers recognise this idiom and optimise it out anyway. Signed-off-by: Sam James <[email protected]>
Still experiencing failures with LLVM 17.0.6 https://termbin.com/j2ey |
I can't reproduce that, I'm afraid. I get failures if I revert my patch, but it passes otherwise. Are you sure it was applied? I also can't see anything obvious that would cause yours if the patch is applied. |
I am 100% the patch is applied, I'm using Nix and it would fail if the patch failed to apply. It said the patch was applied. |
No idea then, unfortunately. You'll need to try debug it. The full build log could also be useful but I don't see myself able to spend more time on a failure I can't reproduce if it's not caused by my PR, sorry. I suggest starting with object files from a good and bad tree and bisecting via those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me. Thanks, @thesamesam
Acked-by: Tom Hromatka <[email protected]>
Merged via 2847f10, thanks for following through with this fix @thesamesam. If anyone is still seeing failures with this patch applies, please open a new issue so we can debug it further. |
Thanks all! |
See #425.
Punning sys_data_b between uint32_t* and struct* seccomp_data isn't legal, use memcpy to fix the testsuite with Clang 17.
Modern compilers recognise this idiom and optimise it out anyway.