mbox series

[net,0/2] net/sched: sch_hfsc: safely allow 'rt' inner curves

Message ID 20231013151057.2611860-1-pctammela@mojatatu.com (mailing list archive)
Headers show
Series net/sched: sch_hfsc: safely allow 'rt' inner curves | expand

Message

Pedro Tammela Oct. 13, 2023, 3:10 p.m. UTC
As reported [1] disallowing 'rt' inner curves breaks already existing
scripts. Even though it doesn't make sense 'qdisc wise' users have been
relying on this behaviour since the qdisc inception.

We need users to update the scripts/applications to use 'sc' or 'ls'
as a inner curve instead of 'rt', but also avoid the UAF found by
Budimir, which was present since the qdisc inception.

Instead of raising an error when classes are added with a 'rt' as a
parent, upgrade the 'rt' to an 'sc' on the fly, avoiding the UAF, and set
a warning for the user. Hopefully the warning laso triggers users to update
their scripts/applications.

[1] https://lore.kernel.org/all/297D84E3-736E-4AB4-B825-264279E2043C@flyingcircus.io/

Pedro Tammela (2):
  Revert "net/sched: sch_hfsc: Ensure inner classes have fsc curve"
  net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner
    curve

 net/sched/sch_hfsc.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

Comments

Jamal Hadi Salim Oct. 16, 2023, 9:48 a.m. UTC | #1
On Fri, Oct 13, 2023 at 11:11 AM Pedro Tammela <pctammela@mojatatu.com> wrote:
>
> As reported [1] disallowing 'rt' inner curves breaks already existing
> scripts. Even though it doesn't make sense 'qdisc wise' users have been
> relying on this behaviour since the qdisc inception.
>
> We need users to update the scripts/applications to use 'sc' or 'ls'
> as a inner curve instead of 'rt', but also avoid the UAF found by
> Budimir, which was present since the qdisc inception.
>
> Instead of raising an error when classes are added with a 'rt' as a
> parent, upgrade the 'rt' to an 'sc' on the fly, avoiding the UAF, and set
> a warning for the user. Hopefully the warning laso triggers users to update
> their scripts/applications.
>
> [1] https://lore.kernel.org/all/297D84E3-736E-4AB4-B825-264279E2043C@flyingcircus.io/
>

For the series:
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

Christian, this should fix it for you but with a caveat: if you
configure a "faulty" inner qdis to be rt it will "fixed" - meaning you
can keep your scripts but when you dump you will see the "fixed"
version instead of the "faulty" one.

cheers,
jamal
Christian Theune Oct. 16, 2023, 9:50 a.m. UTC | #2
Hi,

> On 16. Oct 2023, at 11:48, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> 
> For the series:
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
> 
> Christian, this should fix it for you but with a caveat: if you
> configure a "faulty" inner qdis to be rt it will "fixed" - meaning you
> can keep your scripts but when you dump you will see the "fixed"
> version instead of the "faulty" one.

Thanks a lot, this is absolutely fine for my situation!

Christian