Whamcloud - gitweb
LU-7324 lnet: recv could access freed message 65/17065/4
authorLiang Zhen <liang.zhen@intel.com>
Fri, 6 Nov 2015 14:23:05 +0000 (22:23 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 24 Nov 2015 14:24:53 +0000 (14:24 +0000)
commit01a6f01a4d26831d055552a113ff0fac9547f0aa
tree52f8c50aa2e1822b1f81be25bff72792d5228e20
parent6ff417169a2ad84478cce1b0321e70a030ffed83
LU-7324 lnet: recv could access freed message

When lnet_parse_put calls lnet_ptl_match_md, this function can attach
current message on the delayed list if there is no match. It means
this message can be taken over and freed by another thread who is
posting new MD, then it is not safe for caller of lnet_parse_put to
check this message again.

This patch fixes this issue by adding a local variable "ready_delay"
to store corresponding status of lnet_msg, so lnet doesn't need to
check the message again if lnet_ptl_match_md returned MATCH_NONE for
it.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: I0f8827103dd637648112e936ce6e685266e5ca40
Reviewed-on: http://review.whamcloud.com/17065
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/lnet/lib-move.c