drbd: Use struct_group() to zero algs
authorKees Cook <keescook@chromium.org>
Thu, 18 Nov 2021 20:37:12 +0000 (12:37 -0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Dec 2021 23:31:24 +0000 (16:31 -0700)
commit52a0cab35c568f896067641d8e07f798341954f5
tree9b06ef874eaf498509e2da844c682385743f54b0
parent322c4293ecc58110227b49d7e47ae37b9b03566f
drbd: Use struct_group() to zero algs

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

Add a struct_group() for the algs so that memset() can correctly reason
about the size.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20211118203712.1288866-1-keescook@chromium.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_protocol.h
drivers/block/drbd/drbd_receiver.c