]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx4: Avoid field-overflowing memcpy()
authorKees Cook <keescook@chromium.org>
Wed, 16 Jun 2021 20:37:44 +0000 (13:37 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 22 Jun 2021 00:04:54 +0000 (21:04 -0300)
commit76e5bfcfa521ce75e4bd371a26eb35df487635a8
tree42f292c7ba9d009a2919d826132eabfa05bb0eb0
parentce743076696cfc22d3e92c8299beaf4cf9178f66
IB/mlx4: Avoid field-overflowing memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring array fields.

Use the ether_addr_copy() helper instead, as already done for smac.

Link: https://lore.kernel.org/r/20210616203744.1248551-1-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx4/qp.c