From: Greg Kroah-Hartman Date: Thu, 22 Sep 2016 07:24:24 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.4.22~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=339b543b754e9b3a8ceebf15916e231ba1eca060;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: tipc-move-linearization-of-buffers-to-generic-code.patch --- diff --git a/queue-4.4/series b/queue-4.4/series index 46743f3e17d..62c97a9258b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -5,3 +5,4 @@ mips-kvm-check-for-pfn-noslot-case.patch revert-kvm-x86-fix-missed-hardware-breakpoints.patch fscrypto-require-write-access-to-mount-to-set-encryption-policy.patch lightnvm-put-bio-before-return.patch +tipc-move-linearization-of-buffers-to-generic-code.patch diff --git a/queue-4.4/tipc-move-linearization-of-buffers-to-generic-code.patch b/queue-4.4/tipc-move-linearization-of-buffers-to-generic-code.patch new file mode 100644 index 00000000000..aab53b82db7 --- /dev/null +++ b/queue-4.4/tipc-move-linearization-of-buffers-to-generic-code.patch @@ -0,0 +1,75 @@ +From juerg.haefliger@hpe.com Wed Sep 21 15:00:23 2016 +From: Juerg Haefliger +Date: Wed, 21 Sep 2016 15:00:02 +0200 +Subject: tipc: move linearization of buffers to generic code +To: netdev@vger.kernel.org, davem@davemloft.net +Cc: jonas.arndt@hpe.com, Jon Paul Maloy , Juerg Haefliger +Message-ID: <20160921130002.24939-1-juerg.haefliger@hpe.com> + +From: Jon Paul Maloy + +commit c7cad0d6f70cd4ce8644ffe528a4df1cdc2e77f5 upstream. + +In commit 5cbb28a4bf65c7e4 ("tipc: linearize arriving NAME_DISTR +and LINK_PROTO buffers") we added linearization of NAME_DISTRIBUTOR, +LINK_PROTOCOL/RESET and LINK_PROTOCOL/ACTIVATE to the function +tipc_udp_recv(). The location of the change was selected in order +to make the commit easily appliable to 'net' and 'stable'. + +We now move this linearization to where it should be done, in the +functions tipc_named_rcv() and tipc_link_proto_rcv() respectively. + +Reviewed-by: Ying Xue +Signed-off-by: Jon Maloy +Signed-off-by: David S. Miller +Signed-off-by: Juerg Haefliger +Signed-off-by: Greg Kroah-Hartman + +--- + net/tipc/link.c | 2 ++ + net/tipc/name_distr.c | 1 + + net/tipc/udp_media.c | 5 ----- + 3 files changed, 3 insertions(+), 5 deletions(-) + +--- a/net/tipc/link.c ++++ b/net/tipc/link.c +@@ -1262,6 +1262,8 @@ static int tipc_link_proto_rcv(struct ti + /* fall thru' */ + + case ACTIVATE_MSG: ++ skb_linearize(skb); ++ hdr = buf_msg(skb); + + /* Complete own link name with peer's interface name */ + if_name = strrchr(l->name, ':') + 1; +--- a/net/tipc/name_distr.c ++++ b/net/tipc/name_distr.c +@@ -397,6 +397,7 @@ void tipc_named_rcv(struct net *net, str + + spin_lock_bh(&tn->nametbl_lock); + for (skb = skb_dequeue(inputq); skb; skb = skb_dequeue(inputq)) { ++ skb_linearize(skb); + msg = buf_msg(skb); + mtype = msg_type(msg); + item = (struct distr_item *)msg_data(msg); +--- a/net/tipc/udp_media.c ++++ b/net/tipc/udp_media.c +@@ -48,7 +48,6 @@ + #include + #include "core.h" + #include "bearer.h" +-#include "msg.h" + + /* IANA assigned UDP port */ + #define UDP_PORT_DEFAULT 6118 +@@ -224,10 +223,6 @@ static int tipc_udp_recv(struct sock *sk + { + struct udp_bearer *ub; + struct tipc_bearer *b; +- int usr = msg_user(buf_msg(skb)); +- +- if ((usr == LINK_PROTOCOL) || (usr == NAME_DISTRIBUTOR)) +- skb_linearize(skb); + + ub = rcu_dereference_sk_user_data(sk); + if (!ub) {