lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+h21hp6dFUEA5ALbqcEjVsXXOWG1Up_QtftKWKphjpJz6-JXA@mail.gmail.com>
Date:   Wed, 9 Oct 2019 03:11:10 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Vinicius Costa Gomes <vinicius.gomes@...el.com>
Cc:     netdev <netdev@...r.kernel.org>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net v1] net: taprio: Fix returning EINVAL when configuring
 without flags

On Wed, 9 Oct 2019 at 02:58, Vladimir Oltean <olteanv@...il.com> wrote:
>
> Hi Vinicius,
>
> On Wed, 9 Oct 2019 at 02:19, Vinicius Costa Gomes
> <vinicius.gomes@...el.com> wrote:
> >
> > When configuring a taprio instance if "flags" is not specified (or
> > it's zero), taprio currently replies with an "Invalid argument" error.
> >
> > So, set the return value to zero after we are done with all the
> > checks.
> >
> > Fixes: 9c66d1564676 ("taprio: Add support for hardware offloading")
> > Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@...el.com>
> > ---
>
> You mean clockid, not flags, right?
> Otherwise the patch looks correct, sorry for the bug.
> Once you fix the commit message:
>
> Acked-by: Vladimir Oltean <olteanv@...il.com>
>

No, you are actually right to phrase it this way, but the description
is still confusing. When 'flags' is zero, the driver takes a code path
which is buggy and always returns a negative error code. Although I'm
not really sure how much better this can be phrased. I'm fine with the
description now too.

> >  net/sched/sch_taprio.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
> > index 68b543f85a96..6719a65169d4 100644
> > --- a/net/sched/sch_taprio.c
> > +++ b/net/sched/sch_taprio.c
> > @@ -1341,6 +1341,10 @@ static int taprio_parse_clockid(struct Qdisc *sch, struct nlattr **tb,
> >                 NL_SET_ERR_MSG(extack, "Specifying a 'clockid' is mandatory");
> >                 goto out;
> >         }
> > +
> > +       /* Everything went ok, return success. */
> > +       err = 0;
> > +
> >  out:
> >         return err;
> >  }
> > --
> > 2.23.0
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ