From: David Miller <davem@davemloft.net>
To: petrm@mellanox.com
Cc: netdev@vger.kernel.org, jiri@mellanox.com
Subject: Re: [PATCH net-next] net: sched: Fix hw_stats_type setting in pedit loop
Date: Wed, 18 Mar 2020 16:52:26 -0700 (PDT) [thread overview]
Message-ID: <20200318.165226.1670056436692938282.davem@davemloft.net> (raw)
In-Reply-To: <20200318174229.25482-1-petrm@mellanox.com>
From: Petr Machata <petrm@mellanox.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@mellanox.com>
Good catch, applied, thank you.
prev parent reply other threads:[~2020-03-18 23:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 17:42 [PATCH net-next] net: sched: Fix hw_stats_type setting in pedit loop Petr Machata
2020-03-18 23:52 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200318.165226.1670056436692938282.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jiri@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).