]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: move premature initilalization of stack variables
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 23 Feb 2017 16:10:31 +0000 (11:10 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Feb 2017 16:42:54 +0000 (11:42 -0500)
commit261bc41421cd8aa410fa1c52e6f034fd5f86d336
tree571316773e7f47c7bdb2d86fa599c93de0d76eaa
parent0efb17cea7b5cfd779febc7d9b1fcd94d5c944bf
tipc: move premature initilalization of stack variables

In the function tipc_rcv() we initialize a couple of stack variables
from the message header before that same header has been validated.
In rare cases when the arriving header is non-linar, the validation
function itself may linearize the buffer by calling skb_may_pull(),
while the wrongly initialized stack fields are not updated accordingly.

We fix this in this commit.

Reported-by: Matthew Wong <mwong@sonusnet.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/node.c