HomeFreeBSD

Fix -Wattribute-warning in dsl layer

Description

Fix -Wattribute-warning in dsl layer

The memcpy(), memmove(), and memset() functions have been annotated
to perform bounds checking when using FORTIFY_SOURCE. A warning is
now generted when writing beyond the end of the specified field.

Alternately, the new struct_group() macro could be used to create
an anonymous union member for use by memcpy(). However, since this
is the only place the macro would be helpful it's preferable to
restructure the code slights to avoid the need for additional
compatibility code when the macro does not exist.

https://lore.kernel.org/lkml/20211118183807.1283332-1-keescook@chromium.org/T/

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13528
Closes #13575

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jun 20 2022, 9:13 PM
Parents
rG18df6afdfc63: Fix -Wattribute-warning in edonr
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGff7e405f83fb: Fix -Wattribute-warning in dsl layer (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jun 27 2022, 9:19 PM