act_mirred: clear skb->tstamp on redirect
Subsystems (4)
PATCH 1/1 act_mirred: clear skb->tstamp on redirect
If sch_fq is used at ingress, skbs that might have been timestamped by net_timestamp_set() if a packet capture is requesting timestamps could be delayed by arbitrary amount of time, since sch_fq time base is MONOTONIC.
Fix this problem by moving code from sch_netem.c to act_mirred.c.
Fixes fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC")
Signed-off-by Eric Dumazet <[email protected]>
--- net/sched/act_mirred.c | 3 ++- net/sched/sch_netem.c | 9 --------- 2 files changed, 2 insertions(+), 10 deletions(-)
net/sched/act_mirred.c +2 -1
@@ -258,7 +258,8 @@ static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a,if (is_redirect) { skb2->tc_redirected =1 ; skb2->tc_from_ingress = skb2->tc_at_ingress; - +if (skb2->tc_from_ingress) + skb2->tstamp =0 ;/* let's the caller reinsert the packet, if possible */ if (use_reinsert) { res->ingress = want_ingress;
net/sched/sch_netem.c +0 -9
@@ -648,15 +648,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)*/ skb->dev =qdisc_dev (sch); -#ifdef CONFIG_NET_CLS_ACT -/* -* If it's at ingress let's pretend the delay is -* from the network (tstamp will be updated). -*/ -if (skb->tc_redirected && skb->tc_from_ingress) - skb->tstamp =0 ; -#endif -if (q->slot.slot_next) { q->slot.packets_left--; q->slot.bytes_left -=qdisc_pkt_len (skb);
Signature · 1 line
2.19.1.930.g4563a0d9d0-goog
From: Eric Dumazet <[email protected]>
Date: Sat, 10 Nov 2018 16:22:29 -0800
Quoted 9 lines
If
sch_fqis used at ingress, skbs that might have been timestamped bynet_timestamp_set()if a packet capture is requesting timestamps could be delayed by arbitrary amount of time, sincesch_fqtime base is MONOTONIC.Fix this problem by moving code from
sch_netem.ctoact_mirred.c.Fixes fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC")Signed-off-by Eric Dumazet <[email protected]>
Applied.