This is a note to let you know that I've just added the patch titled

    net: Make qdisc_skb_cb upper size bound explicit.

to the 3.0-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-make-qdisc_skb_cb-upper-size-bound-explicit.patch
and it can be found in the queue-3.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From a772cf60ab184e3a8028d0de2d30ec450fdca89a Mon Sep 17 00:00:00 2001
From: "David S. Miller" <[email protected]>
Date: Mon, 6 Feb 2012 15:14:37 -0500
Subject: net: Make qdisc_skb_cb upper size bound explicit.


From: "David S. Miller" <[email protected]>

[ Upstream commit 16bda13d90c8d5da243e2cfa1677e62ecce26860 ]

Just like skb->cb[], so that qdisc_skb_cb can be encapsulated inside
of other data structures.

This is intended to be used by IPoIB so that it can remember
addressing information stored at hard_header_ops->create() time that
it can fetch when the packet gets to the transmit routine.

Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 include/net/sch_generic.h |    9 ++++++++-
 net/sched/sch_choke.c     |    3 +--
 net/sched/sch_netem.c     |    3 +--
 net/sched/sch_sfb.c       |    3 +--
 4 files changed, 11 insertions(+), 7 deletions(-)

--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -219,9 +219,16 @@ struct tcf_proto {
 
 struct qdisc_skb_cb {
        unsigned int            pkt_len;
-       long                    data[];
+       unsigned char           data[24];
 };
 
+static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
+{
+       struct qdisc_skb_cb *qcb;
+       BUILD_BUG_ON(sizeof(skb->cb) < sizeof(unsigned int) + sz);
+       BUILD_BUG_ON(sizeof(qcb->data) < sz);
+}
+
 static inline int qdisc_qlen(struct Qdisc *q)
 {
        return q->q.qlen;
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -225,8 +225,7 @@ struct choke_skb_cb {
 
 static inline struct choke_skb_cb *choke_skb_cb(const struct sk_buff *skb)
 {
-       BUILD_BUG_ON(sizeof(skb->cb) <
-               sizeof(struct qdisc_skb_cb) + sizeof(struct choke_skb_cb));
+       qdisc_cb_private_validate(skb, sizeof(struct choke_skb_cb));
        return (struct choke_skb_cb *)qdisc_skb_cb(skb)->data;
 }
 
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -117,8 +117,7 @@ struct netem_skb_cb {
 
 static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
 {
-       BUILD_BUG_ON(sizeof(skb->cb) <
-               sizeof(struct qdisc_skb_cb) + sizeof(struct netem_skb_cb));
+       qdisc_cb_private_validate(skb, sizeof(struct netem_skb_cb));
        return (struct netem_skb_cb *)qdisc_skb_cb(skb)->data;
 }
 
--- a/net/sched/sch_sfb.c
+++ b/net/sched/sch_sfb.c
@@ -93,8 +93,7 @@ struct sfb_skb_cb {
 
 static inline struct sfb_skb_cb *sfb_skb_cb(const struct sk_buff *skb)
 {
-       BUILD_BUG_ON(sizeof(skb->cb) <
-               sizeof(struct qdisc_skb_cb) + sizeof(struct sfb_skb_cb));
+       qdisc_cb_private_validate(skb, sizeof(struct sfb_skb_cb));
        return (struct sfb_skb_cb *)qdisc_skb_cb(skb)->data;
 }
 


Patches currently in stable-queue which might be from [email protected] are

queue-3.0/ipv4-fix-redirect-handling.patch
queue-3.0/ipv4-fix-wrong-order-of-ip_rt_get_source-and-update-iph-daddr.patch
queue-3.0/gro-more-generic-l2-header-check.patch
queue-3.0/netpoll-netpoll_poll_dev-should-access-dev-flags.patch
queue-3.0/route-fix-icmp-redirect-validation.patch
queue-3.0/3c59x-shorten-timer-period-for-slave-devices.patch
queue-3.0/tcp-fix-tcp_shifted_skb-adjustment-of-lost_cnt_hint-for-fack.patch
queue-3.0/veth-enforce-minimum-size-of-veth_info_peer.patch
queue-3.0/ipheth-add-iphone-4s.patch
queue-3.0/via-velocity-s3-resume-fix.patch
queue-3.0/ipv4-fix-for-ip_options_rcv_srr-daddr-update.patch
queue-3.0/ipv4-reset-flowi-parameters-on-route-connect.patch
queue-3.0/tcp-allow-tcp_sacktag_one-to-tag-ranges-not-aligned-with-skbs.patch
queue-3.0/ipv6-multicast-fix-memory-leak-in-ipv6-multicast.patch
queue-3.0/ipoib-stop-lying-about-hard_header_len-and-use-skb-cb-to-stash-ll-addresses.patch
queue-3.0/net-make-qdisc_skb_cb-upper-size-bound-explicit.patch
queue-3.0/tcp_v4_send_reset-binding-oif-to-iif-in-no-sock-case.patch
queue-3.0/ipv6-multicast-fix-memory-leak-in-input-path.patch
queue-3.0/ipv4-save-nexthop-address-of-lsrr-ssrr-option-to-ipcb.patch
queue-3.0/tcp-fix-range-tcp_shifted_skb-passes-to-tcp_sacktag_one.patch
queue-3.0/net_sched-bug-in-netem-reordering.patch
queue-3.0/net-don-t-proxy-arp-respond-if-iif-rt-dst.dev-if-private-vlan-is-disabled.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to