From: Thomas Graf <tgraf@suug.ch>
To: David Miller <davem@davemloft.net>
Cc: alexander.duyck@gmail.com, shemminger@vyatta.com,
jeffrey.t.kirsher@intel.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
alexander.h.duyck@intel.com
Subject: [PATCH 2.6.26.y] sch_prio: Fix nla_parse_nested_compat() regression
Date: Thu, 28 Aug 2008 15:03:31 +0200 [thread overview]
Message-ID: <20080828130331.GA20815@postel.suug.ch> (raw)
In-Reply-To: <20080828.031943.114025230.davem@davemloft.net>
nla_parse_nested_compat() was used to parse two different message
formats in the netem and prio qdisc, when it was "fixed" to work
with netem, it broke the multi queue support in the prio qdisc.
Since the prio qdisc code in question is already removed in the
development tree, this patch only fixes the regression in the
stable tree.
Based on original patch from Alexander H Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Index: linux-2.6.26.y/net/sched/sch_prio.c
===================================================================
--- linux-2.6.26.y.orig/net/sched/sch_prio.c 2008-08-28 13:24:22.000000000 +0200
+++ linux-2.6.26.y/net/sched/sch_prio.c 2008-08-28 14:16:44.000000000 +0200
@@ -228,14 +228,20 @@
{
struct prio_sched_data *q = qdisc_priv(sch);
struct tc_prio_qopt *qopt;
- struct nlattr *tb[TCA_PRIO_MAX + 1];
+ struct nlattr *tb[TCA_PRIO_MAX + 1] = {0};
int err;
int i;
- err = nla_parse_nested_compat(tb, TCA_PRIO_MAX, opt, NULL, qopt,
- sizeof(*qopt));
- if (err < 0)
- return err;
+ qopt = nla_data(opt);
+ if (nla_len(opt) < sizeof(*qopt))
+ return -1;
+
+ if (nla_len(opt) >= sizeof(*qopt) + sizeof(struct nlattr)) {
+ err = nla_parse_nested(tb, TCA_PRIO_MAX,
+ (struct nlattr *) (qopt + 1), NULL);
+ if (err < 0)
+ return err;
+ }
q->bands = qopt->bands;
/* If we're multiqueue, make sure the number of incoming bands
next prev parent reply other threads:[~2008-08-28 13:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-22 0:50 [PATCH] IPROUTE: correct nla nested message generated by netem_parse_opt Jeff Kirsher
2008-08-22 1:19 ` Stephen Hemminger
2008-08-22 2:37 ` Alexander Duyck
2008-08-22 10:44 ` David Miller
2008-08-27 14:41 ` Thomas Graf
2008-08-27 16:30 ` Duyck, Alexander H
2008-08-27 20:47 ` Thomas Graf
2008-08-27 21:10 ` Stephen Hemminger
2008-08-28 6:47 ` David Miller
2008-08-28 10:18 ` Thomas Graf
2008-08-28 10:19 ` David Miller
2008-08-28 13:03 ` Thomas Graf [this message]
2008-09-03 0:31 ` [PATCH 2.6.26.y] sch_prio: Fix nla_parse_nested_compat() regression David Miller
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=20080828130331.GA20815@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=akpm@linux-foundation.org \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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).