This is a note to let you know that I've just added the patch titled net_sched: better precise estimation on packet length for untrusted packets to the 3.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net_sched-better-precise-estimation-on-packet-length-for-untrusted-packets.patch and it can be found in the queue-3.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From a21d200256ebea2a614980c1875c68aae0093b17 Mon Sep 17 00:00:00 2001 From: Jason Wang <jasowang@xxxxxxxxxx> Date: Mon, 25 Mar 2013 20:19:59 +0000 Subject: net_sched: better precise estimation on packet length for untrusted packets From: Jason Wang <jasowang@xxxxxxxxxx> [ Upstream commit 15e5a030716468dce4032fa0f398d840fa2756f6 ] gso_segs were reset to zero when kernel receive packets from untrusted source. But we use this zero value to estimate precise packet len which is wrong. So this patch tries to estimate the correct gso_segs value before using it in qdisc_pkt_len_init(). Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx> Cc: Eric Dumazet <edumazet@xxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/core/dev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2592,6 +2592,7 @@ static void qdisc_pkt_len_init(struct sk */ if (shinfo->gso_size) { unsigned int hdr_len; + u16 gso_segs = shinfo->gso_segs; /* mac layer + network layer */ hdr_len = skb_transport_header(skb) - skb_mac_header(skb); @@ -2601,7 +2602,12 @@ static void qdisc_pkt_len_init(struct sk hdr_len += tcp_hdrlen(skb); else hdr_len += sizeof(struct udphdr); - qdisc_skb_cb(skb)->pkt_len += (shinfo->gso_segs - 1) * hdr_len; + + if (shinfo->gso_type & SKB_GSO_DODGY) + gso_segs = DIV_ROUND_UP(skb->len - hdr_len, + shinfo->gso_size); + + qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len; } } Patches currently in stable-queue which might be from jasowang@xxxxxxxxxx are queue-3.9/tuntap-forbid-changing-mq-flag-for-persistent-device.patch queue-3.9/packet-set-transport-header-before-doing-xmit.patch queue-3.9/netback-set-transport-header-before-passing-it-to-kernel.patch queue-3.9/net_sched-better-precise-estimation-on-packet-length-for-untrusted-packets.patch queue-3.9/tuntap-set-sock_zerocopy-flag-during-open.patch queue-3.9/tuntap-set-transport-header-before-passing-it-to-kernel.patch queue-3.9/tuntap-correct-the-return-value-in-tun_set_iff.patch queue-3.9/macvtap-set-transport-header-before-passing-skb-to-lower-device.patch queue-3.9/vhost_net-clear-msg.control-for-non-zerocopy-case-during-tx.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html