Whamcloud - gitweb
LU-15914 lnet: Fix null md deref for finalized message 46/47546/4
authorChris Horn <chris.horn@hpe.com>
Mon, 6 Jun 2022 18:09:03 +0000 (13:09 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 30 Jun 2022 03:52:29 +0000 (03:52 +0000)
commitcb0220db3ce517b0e2fce93c864e6c3dbb61b5e0
tree1d0bf0c5aeb717aa0c17f7349559a047cea4388b
parent716ac65ef6315f771eb3382b42bb2bb1a22a7391
LU-15914 lnet: Fix null md deref for finalized message

When a message is finalized the lnet_msg:msg_md field may be cleared
(see lnet_finalize() -> lnet_msg_detach_md()).
When an LNet router is forwarding such message, or if an ACK has been
requested for such a message, then the NULL msg_md may be deref'd in
lnet_get_best_ni(). Check for this in lnet_get_best_ni() before
dereferencing the MD.

It may also be dereferenced in kiblnd_send(), so check for this
situation there, too. Some style cleanup is included in
kiblnd_send().

Test-Parameters: trivial
Fixes: 959304eac7 ("LU-15189 lnet: fix memory mapping.")
HPE-bug-id: LUS-10997
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I3cfdc8d342bd3b49a61d1ce6c31a245848accf8f
Reviewed-on: https://review.whamcloud.com/47546
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd_cb.c
lnet/lnet/lib-move.c