Skip to content

Commit 5cbb28a

Browse files
Jon Paul Maloydavem330
authored andcommitted
tipc: linearize arriving NAME_DISTR and LINK_PROTO buffers
Testing of the new UDP bearer has revealed that reception of NAME_DISTRIBUTOR, LINK_PROTOCOL/RESET and LINK_PROTOCOL/ACTIVATE message buffers is not prepared for the case that those may be non-linear. We now linearize all such buffers before they are delivered up to the generic reception layer. In order for the commit to apply cleanly to 'net' and 'stable', we do the change in the function tipc_udp_recv() for now. Later, we will post a commit to 'net-next' moving the linearization to generic code, in tipc_named_rcv() and tipc_link_proto_rcv(). Fixes: commit d0f9193 ("tipc: add ip/udp media type") Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f444457 commit 5cbb28a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/tipc/udp_media.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include <linux/tipc_netlink.h>
4949
#include "core.h"
5050
#include "bearer.h"
51+
#include "msg.h"
5152

5253
/* IANA assigned UDP port */
5354
#define UDP_PORT_DEFAULT 6118
@@ -222,6 +223,10 @@ static int tipc_udp_recv(struct sock *sk, struct sk_buff *skb)
222223
{
223224
struct udp_bearer *ub;
224225
struct tipc_bearer *b;
226+
int usr = msg_user(buf_msg(skb));
227+
228+
if ((usr == LINK_PROTOCOL) || (usr == NAME_DISTRIBUTOR))
229+
skb_linearize(skb);
225230

226231
ub = rcu_dereference_sk_user_data(sk);
227232
if (!ub) {

0 commit comments

Comments
 (0)