netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org, jhs@mojatatu.com, jiri@resnulli.us,
	alexander.h.duyck@intel.com, xiyou.wangcong@gmail.com
Subject: act_skbedit unable to check queue_mapping at init time
Date: Wed, 11 Oct 2017 12:02:35 -0700	[thread overview]
Message-ID: <c48c8af5-d4c6-d2f7-cc0f-6cb50f2a865e@gmail.com> (raw)

Hi all,

It is perfectly possible for the following to happen:

# ls /sys/class/net/gphy/queues
rx-0  tx-0  tx-1  tx-2  tx-3
# tc qdisc add dev gphy root handle 1: multiq
# tc filter add dev gphy parent 1: protocol ip prio 1 u32
 match ip dst 192.168.1.1 action skbedit queue_mapping 5

that specifies a queue_mapping value that exceeds what the underlying
device supports. There is a check for dev->real_num_tx_queue >
d->queue_mapping in tcf_skbedit() which makes sure we won't overflow the
queue space, but this will essentially render the action inactive.

I can't find a way to get a reference on a network device from a
tc_action_ops->init function in order to validate that the queue_mapping
is valid at ->init() time and return an appropriate error if we are
exceeding what the device does. This is an action chained to a match and
a filter, so somehow one would think it would be possible to obtain a
reference on the network device the filter was installed on...

Any clues how we could fix that?
-- 
Florian

             reply	other threads:[~2017-10-11 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 19:02 Florian Fainelli [this message]
2017-10-16 17:36 ` act_skbedit unable to check queue_mapping at init time Cong Wang

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=c48c8af5-d4c6-d2f7-cc0f-6cb50f2a865e@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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).