-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Linux 6.3 compat: Fix memcpy "detected field-spanning write" error #14737
Conversation
Mightn't it be better to do a define for which function to use and call that define, so that we don't have to remember to update both sides of the ifdef every time going forward? |
Signed-off-by: Youzhong Yang <yyang@mathworks.com>
I looked at the Linux kernel side of changes, most of them took the approach of changing struct definition. I thought about it, this is likely the best way to address this issue. I see no harm adding a new union member, if you have any objection, please let me know. |
I'd recommend at least a comment explaining why that's necessary, if you're going to do it that way. |
Signed-off-by: Youzhong Yang <yyang@mathworks.com>
This doesn't compile on FreeBSD (with clang): In file included from /root/github/pjd/openzfs/module/os/freebsd/zfs/dmu_os.c:39: |
Unfortunately the FreeBSD builder was offline and we failed to notice this does introduce a build failure on FreeBSD. We'll either need to revert this for now, or wrap this GNU extension in a |
I looked at Linux kernel src a bit and didn't find anything special. I've created a PR following your suggestion. I am on the road and will do more research about this clang flexible array thing. If someone has better idea tackling this issue, please advise in the PR. |
Add a new union member of flexible array to dnode_phys_t and use it in the macro so we can silence the memcpy() fortify error. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14737
Add a new union member of flexible array to dnode_phys_t and use it in the macro so we can silence the memcpy() fortify error. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14737
Add a new union member of flexible array to dnode_phys_t and use it in the macro so we can silence the memcpy() fortify error. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14737
Add a new union member of flexible array to dnode_phys_t and use it in the macro so we can silence the memcpy() fortify error. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes openzfs#14737
Add a new union member of flexible array to dnode_phys_t and use it in the macro so we can silence the memcpy() fortify error. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes #14737
Signed-off-by: Youzhong Yang yyang@mathworks.com
Motivation and Context
The following errors were observed when running zfs test suite:
The fortified memcpy() and memmove() starting from Linux kernel 6.1+ will generate the above warning message when copying bonus data of more than 320 bytes into the dnode_phys_t.
The error could be reproduced by /usr/share/zfs/zfs-tests.sh -T zfs_diff.
Description
Add a new union member of flexible array to dnode_phys_t and use it in the macro so we can silence the memcpy() fortify error.
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.