]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: unclone unbundled buffers before forwarding
authorJon Paul Maloy <jon.maloy@ericsson.com>
Mon, 20 Jun 2016 13:20:46 +0000 (09:20 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jun 2016 20:33:35 +0000 (16:33 -0400)
commitc658f6dbdba633702715057c1a6d99b8fd9883e4
treebd1f497b8fa1a78ecef25876eb28dceb37604408
parent0cf8e66be8466f21b98f01d05b3daa0e579bb04f
tipc: unclone unbundled buffers before forwarding

When extracting an individual message from a received "bundle" buffer,
we just create a clone of the base buffer, and adjust it to point into
the right position of the linearized data area of the latter. This works
well for regular message reception, but during periods of extremely high
load it may happen that an extracted buffer, e.g, a connection probe, is
reversed and forwarded through an external interface while the preceding
extracted message is still unhandled. When this happens, the header or
data area of the preceding message will be partially overwritten by a
MAC header, leading to unpredicatable consequences, such as a link
reset.

We now fix this by ensuring that the msg_reverse() function never
returns a cloned buffer, and that the returned buffer always contains
sufficient valid head and tail room to be forwarded.

Reported-by: Erik Hugne <erik.hugne@gmail.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/msg.c
net/tipc/msg.h