]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mthca: Use memset_startat() for clearing mpt_entry
authorKees Cook <keescook@chromium.org>
Mon, 13 Dec 2021 22:33:28 +0000 (14:33 -0800)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 15 Dec 2021 00:21:23 +0000 (20:21 -0400)
commit197d6d37c8566d4089db3f1b515a1667b75e81ac
treed787a8f46d2452c30ecddab354b0737daadbf0dc
parentbc942709e2a7b4f4b863995724934b4f1153af5b
IB/mthca: Use memset_startat() for clearing mpt_entry

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

Use memset_startat() so memset() doesn't get confused about writing beyond
the destination member that is intended to be the starting point of
zeroing through the end of the struct.

Link: https://lore.kernel.org/r/20211213223331.135412-15-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mthca/mthca_mr.c