diff options
| author | Kees Cook <keescook@chromium.org> | 2021-06-17 00:24:37 +0300 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-06-19 06:27:04 +0300 |
| commit | 041761f4a4db662e38b4ae9d510b8beb24c7d4b6 (patch) | |
| tree | 9251c7f8debfe4798b9ff533a5b8efdf36a5186b /scripts/gcc-plugins/sancov_plugin.c | |
| parent | 86a6a0bdbe2beb4cc7bc80eccd835b62a1f0c364 (diff) | |
| download | linux-041761f4a4db662e38b4ae9d510b8beb24c7d4b6.tar.xz | |
scsi: aha1740: Avoid over-read of sense buffer
In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally reading across neighboring array fields.
SCtmp->sense_buffer is 96 bytes, but ecbptr->sense is 14 bytes. Instead of
over-reading ecbptr->sense, copy only the actual contents and zero pad the
remaining bytes, avoiding potential over-reads.
Link: https://lore.kernel.org/r/20210616212437.1727088-1-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'scripts/gcc-plugins/sancov_plugin.c')
0 files changed, 0 insertions, 0 deletions
