The flexible array at the end of srcp_bulk is triggering a
false positive in fortified memcpy(). Quash it with
unsafe_memcpy().
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I13386c0a8e73b04af8d398aa49361bfdf6a05ad8
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50185
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (rc != 0)
return rc;
- memcpy(&rpc->crpc_bulk, bulk, offsetof(struct srpc_bulk, bk_iovs[npg]));
+ unsafe_memcpy(&rpc->crpc_bulk, bulk,
+ offsetof(struct srpc_bulk, bk_iovs[npg]),
+ FLEXIBLE_OBJECT);
if (opc == LST_BRW_WRITE)
brw_fill_bulk(&rpc->crpc_bulk, flags, BRW_MAGIC);
else