[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200318.165226.1670056436692938282.davem@davemloft.net>
Date: Wed, 18 Mar 2020 16:52:26 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: petrm@...lanox.com
Cc: netdev@...r.kernel.org, jiri@...lanox.com
Subject: Re: [PATCH net-next] net: sched: Fix hw_stats_type setting in
pedit loop
From: Petr Machata <petrm@...lanox.com>
Date: Wed, 18 Mar 2020 19:42:29 +0200
> In the commit referenced below, hw_stats_type of an entry is set for every
> entry that corresponds to a pedit action. However, the assignment is only
> done after the entry pointer is bumped, and therefore could overwrite
> memory outside of the entries array.
>
> The reason for this positioning may have been that the current entry's
> hw_stats_type is already set above, before the action-type dispatch.
> However, if there are no more actions, the assignment is wrong. And if
> there are, the next round of the for_each_action loop will make the
> assignment before the action-type dispatch anyway.
>
> Therefore fix this issue by simply reordering the two lines.
>
> Fixes: 74522e7baae2 ("net: sched: set the hw_stats_type in pedit loop")
> Signed-off-by: Petr Machata <petrm@...lanox.com>
Good catch, applied, thank you.
Powered by blists - more mailing lists