Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f94dca9
)
LU-17545 lnet: use unsafe_memcpy() when flexible array
69/54069/2
author
Bruno Faccini
<bfaccini@nvidia.com>
Thu, 15 Feb 2024 18:07:00 +0000
(19:07 +0100)
committer
Oleg Drokin
<green@whamcloud.com>
Mon, 4 Mar 2024 20:04:37 +0000
(20:04 +0000)
To avoid <memcpy: detected field-spanning write (size 64)
of single field "&lp->lp_data->pb_info" at
.../lnet/lnet/peer.c:2456 (size 16)> false positive
msgs/error.
Signed-off-by: Bruno Faccini <bfaccini@nvidia.com>
Change-Id: I4e2fc58e31f60b434a9050393cd65b89c54f0798
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54069
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/peer.c
patch
|
blob
|
history
diff --git
a/lnet/lnet/peer.c
b/lnet/lnet/peer.c
index
40ce284
..
5c3f3d3
100644
(file)
--- 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),