From 450b55a50f2c3e2c68a72902046cb7d448413245 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Thu, 15 Feb 2024 19:07:00 +0100 Subject: [PATCH] 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. Lustre-change: https://review.whamcloud.com/54069 Lustre-commit: 1b936f5b545f804f3ed21a18f90ceafd705291b2 Signed-off-by: Bruno Faccini Change-Id: I4e2fc58e31f60b434a9050393cd65b89c54f0798 Reviewed-by: Shaun Tancheff Reviewed-by: Arshad Hussain Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54290 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lnet/lnet/peer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index 7362e0c..b1283e9 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -2453,8 +2453,8 @@ void lnet_peer_push_event(struct lnet_event *ev) if (LNET_PING_BUFFER_SEQNO(pbuf) > LNET_PING_BUFFER_SEQNO(lp->lp_data) && pbuf->pb_info.pi_nnis <= lp->lp_data->pb_nnis) { - memcpy(&lp->lp_data->pb_info, &pbuf->pb_info, - LNET_PING_INFO_SIZE(pbuf->pb_info.pi_nnis)); + unsafe_memcpy(&lp->lp_data->pb_info, &pbuf->pb_info, + LNET_PING_INFO_SIZE(pbuf->pb_info.pi_nnis), FLEXIBLE_OBJECT); CDEBUG(D_NET, "Ping/Push race from %s: %u vs %u\n", libcfs_nid2str(lp->lp_primary_nid), LNET_PING_BUFFER_SEQNO(pbuf), -- 1.8.3.1