[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpUN3mECayC9pCDrmG5OGcGrpngmBCsgKawG3hCrn0uGkQ@mail.gmail.com>
Date: Wed, 21 Nov 2018 10:05:57 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Davide Caratti <dcaratti@...hat.com>
Cc: Eric Dumazet <edumazet@...gle.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>,
David Miller <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
Ivan Vecera <ivecera@...hat.com>
Subject: Re: [PATCH net v2] net/sched: act_police: fix race condition on state variables
On Tue, Nov 20, 2018 at 1:19 PM Davide Caratti <dcaratti@...hat.com> wrote:
> @@ -257,25 +261,28 @@ static int tcf_police_act(struct sk_buff *skb, const struct tc_action *a,
> }
>
> now = ktime_get_ns();
> - toks = min_t(s64, now - p->tcfp_t_c, p->tcfp_burst);
> + spin_lock_bh(&police->tcfp_lock);
> + toks = min_t(s64, now - police->tcfp_t_c, p->tcfp_burst);
I don't think you need to disable BH here.
Powered by blists - more mailing lists