summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2021-11-18 21:38:07 +0300
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-01-04 14:00:06 +0300
commit23c72ffedeed6d513144fa09834b1eb0cb2b7373 (patch)
tree0502038cf25290c450ae71da78f8f2df681598bf /net
parent49737f261c412ea7c4ca583317a9b094c0aaed49 (diff)
downloadlinux-23c72ffedeed6d513144fa09834b1eb0cb2b7373.tar.xz
ata: sata_fsl: Use struct_group() for memcpy() region
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct command_desc around members acmd and fill, so they can be referenced together. This will allow memset(), memcpy(), and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of acmd: In function 'fortify_memset_chk', inlined from 'sata_fsl_qc_prep' at drivers/ata/sata_fsl.c:534:3: ./include/linux/fortify-string.h:199:4: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] 199 | __write_overflow_field(); | ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions