Commit bec161ad authored by Taehee Yoo's avatar Taehee Yoo Committed by Jakub Kicinski

amt: do not use overwrapped cb area

amt driver uses skb->cb for storing tunnel information.
This job is worked before TC layer and then amt driver load tunnel info
from skb->cb after TC layer.
So, its cb area should not be overwrapped with CB area used by TC.
In order to not use cb area used by TC, it skips the biggest cb
structure used by TC, which was qdisc_skb_cb.
But it's not anymore.
Currently, biggest structure of TC's CB is tc_skb_cb.
So, it should skip size of tc_skb_cb instead of qdisc_skb_cb.

Fixes: ec624fe7 ("net/sched: Extend qdisc control block with tc control block")
Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20240107144241.4169520-1-ap420073@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 66cee759
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/net.h> #include <linux/net.h>
#include <linux/igmp.h> #include <linux/igmp.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <net/sch_generic.h> #include <net/pkt_sched.h>
#include <net/net_namespace.h> #include <net/net_namespace.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/udp.h> #include <net/udp.h>
...@@ -80,11 +80,11 @@ static struct mld2_grec mldv2_zero_grec; ...@@ -80,11 +80,11 @@ static struct mld2_grec mldv2_zero_grec;
static struct amt_skb_cb *amt_skb_cb(struct sk_buff *skb) static struct amt_skb_cb *amt_skb_cb(struct sk_buff *skb)
{ {
BUILD_BUG_ON(sizeof(struct amt_skb_cb) + sizeof(struct qdisc_skb_cb) > BUILD_BUG_ON(sizeof(struct amt_skb_cb) + sizeof(struct tc_skb_cb) >
sizeof_field(struct sk_buff, cb)); sizeof_field(struct sk_buff, cb));
return (struct amt_skb_cb *)((void *)skb->cb + return (struct amt_skb_cb *)((void *)skb->cb +
sizeof(struct qdisc_skb_cb)); sizeof(struct tc_skb_cb));
} }
static void __amt_source_gc_work(void) static void __amt_source_gc_work(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment