]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up queue-4.19/sch_cbq-validate-tca_cbq_wrropt-to-avoid-crash.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Oct 2019 09:09:24 +0000 (11:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Oct 2019 09:09:24 +0000 (11:09 +0200)
queue-4.19/sch_cbq-validate-tca_cbq_wrropt-to-avoid-crash.patch

index 72eb9055cb7a37e60abec5b107aa4c5e1c31c4ee..e7187b9a5f1ba8827fdce215458bc9ebb96438ae 100644 (file)
@@ -57,14 +57,12 @@ Reported-by: syzbot <syzkaller@googlegroups.com>
 Signed-off-by: David S. Miller <davem@davemloft.net>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- net/sched/sch_cbq.c | 43 +++++++++++++++++++++++++++++--------------
- 1 file changed, 29 insertions(+), 14 deletions(-)
+ net/sched/sch_cbq.c |   40 ++++++++++++++++++++++++++++------------
+ 1 file changed, 28 insertions(+), 12 deletions(-)
 
-diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
-index 06c7a2da21bc..39b427dc7512 100644
 --- a/net/sched/sch_cbq.c
 +++ b/net/sched/sch_cbq.c
-@@ -1127,6 +1127,33 @@ static const struct nla_policy cbq_policy[TCA_CBQ_MAX + 1] = {
+@@ -1132,6 +1132,32 @@ static const struct nla_policy cbq_polic
        [TCA_CBQ_POLICE]        = { .len = sizeof(struct tc_cbq_police) },
  };
  
@@ -79,8 +77,7 @@ index 06c7a2da21bc..39b427dc7512 100644
 +              return -EINVAL;
 +      }
 +
-+      err = nla_parse_nested_deprecated(tb, TCA_CBQ_MAX, opt,
-+                                        cbq_policy, extack);
++      err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy, extack);
 +      if (err < 0)
 +              return err;
 +
@@ -98,7 +95,7 @@ index 06c7a2da21bc..39b427dc7512 100644
  static int cbq_init(struct Qdisc *sch, struct nlattr *opt,
                    struct netlink_ext_ack *extack)
  {
-@@ -1139,13 +1166,7 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt,
+@@ -1144,12 +1170,7 @@ static int cbq_init(struct Qdisc *sch, s
        hrtimer_init(&q->delay_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED);
        q->delay_timer.function = cbq_undelay;
  
@@ -107,13 +104,12 @@ index 06c7a2da21bc..39b427dc7512 100644
 -              return -EINVAL;
 -      }
 -
--      err = nla_parse_nested_deprecated(tb, TCA_CBQ_MAX, opt, cbq_policy,
--                                        extack);
+-      err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy, extack);
 +      err = cbq_opt_parse(tb, opt, extack);
        if (err < 0)
                return err;
  
-@@ -1464,13 +1485,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
+@@ -1466,12 +1487,7 @@ cbq_change_class(struct Qdisc *sch, u32
        struct cbq_class *parent;
        struct qdisc_rate_table *rtab = NULL;
  
@@ -122,12 +118,8 @@ index 06c7a2da21bc..39b427dc7512 100644
 -              return -EINVAL;
 -      }
 -
--      err = nla_parse_nested_deprecated(tb, TCA_CBQ_MAX, opt, cbq_policy,
--                                        extack);
+-      err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy, extack);
 +      err = cbq_opt_parse(tb, opt, extack);
        if (err < 0)
                return err;
  
--- 
-2.20.1
-