Thread (12 messages) 12 messages, 4 authors, 2021-04-23

Re: [PATCH net 2/2] net/sched: sch_frag: fix stack OOB read while fragmenting IPv4 packets

From: Cong Wang <hidden>
Date: 2021-04-19 18:46:53

On Mon, Apr 19, 2021 at 8:24 AM Davide Caratti [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/sched/sch_frag.c b/net/sched/sch_frag.c
index e1e77d3fb6c0..8c06381391d6 100644
--- a/net/sched/sch_frag.c
+++ b/net/sched/sch_frag.c
@@ -90,16 +90,16 @@ static int sch_fragment(struct net *net, struct sk_buff *skb,
        }

        if (skb_protocol(skb, true) == htons(ETH_P_IP)) {
-               struct dst_entry sch_frag_dst;
+               struct rtable sch_frag_rt = { 0 };
Is setting these fields 0 sufficient here? Because normally a struct table
is initialized by rt_dst_alloc() which sets several of them to non-zero,
notably, rt->rt_type and rt->rt_uncached.

Similar for the IPv6 part, which is initialized by rt6_info_init().

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help