提交 99c14593 编写于 作者: A Allan Stephens 提交者: David S. Miller

tipc: Fix bugs in rejection of message with short header

This patch ensures that TIPC doesn't try to access non-existent
message header fields when rejecting a message with a short header.
Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9bef5438
......@@ -448,13 +448,15 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
msg_set_errcode(rmsg, err);
msg_set_destport(rmsg, msg_origport(msg));
msg_set_origport(rmsg, msg_destport(msg));
if (msg_short(msg))
if (msg_short(msg)) {
msg_set_orignode(rmsg, tipc_own_addr);
else
/* leave name type & instance as zeroes */
} else {
msg_set_orignode(rmsg, msg_destnode(msg));
msg_set_nametype(rmsg, msg_nametype(msg));
msg_set_nameinst(rmsg, msg_nameinst(msg));
}
msg_set_size(rmsg, data_sz + hdr_sz);
msg_set_nametype(rmsg, msg_nametype(msg));
msg_set_nameinst(rmsg, msg_nameinst(msg));
skb_copy_to_linear_data_offset(rbuf, hdr_sz, msg_data(msg), data_sz);
/* send self-abort message when rejecting on a connected port */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册