From: Bruno Faccini Date: Thu, 15 Feb 2024 18:07:00 +0000 (+0100) Subject: LU-17545 lnet: use unsafe_memcpy() when flexible array X-Git-Tag: 2.15.62~139 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1b936f5b545f804f3ed21a18f90ceafd705291b2;p=fs%2Flustre-release.git LU-17545 lnet: use unsafe_memcpy() when flexible array To avoid lp_data->pb_info" at .../lnet/lnet/peer.c:2456 (size 16)> false positive msgs/error. Signed-off-by: Bruno Faccini Change-Id: I4e2fc58e31f60b434a9050393cd65b89c54f0798 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54069 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index 40ce284..5c3f3d3 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -2619,8 +2619,8 @@ void lnet_peer_push_event(struct lnet_event *ev) if (LNET_PING_BUFFER_SEQNO(pbuf) > LNET_PING_BUFFER_SEQNO(lp->lp_data) && infobytes <= lp->lp_data->pb_nbytes) { - memcpy(&lp->lp_data->pb_info, &pbuf->pb_info, - infobytes); + unsafe_memcpy(&lp->lp_data->pb_info, &pbuf->pb_info, + infobytes, FLEXIBLE_OBJECT); CDEBUG(D_NET, "Ping/Push race from %s: %u vs %u\n", libcfs_nidstr(&lp->lp_primary_nid), LNET_PING_BUFFER_SEQNO(pbuf),