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: <d3e996fdeea5eafad9d4f827d5d0cd7102ec4c4b.camel@nvidia.com>
Date:   Thu, 26 Aug 2021 17:42:13 +0000
From:   Saeed Mahameed <saeedm@...dia.com>
To:     Maxim Mikityanskiy <maximmi@...dia.com>,
        "jhs@...atatu.com" <jhs@...atatu.com>,
        "jiri@...nulli.us" <jiri@...nulli.us>,
        "eric.dumazet@...il.com" <eric.dumazet@...il.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>,
        "davem@...emloft.net" <davem@...emloft.net>
CC:     Tariq Toukan <tariqt@...dia.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net] sch_htb: Fix inconsistency when leaf qdisc creation
 fails

On Thu, 2021-08-26 at 09:10 -0700, Eric Dumazet wrote:
> 
> 
> On 8/26/21 4:54 AM, Maxim Mikityanskiy wrote:
> > In HTB offload mode, qdiscs of leaf classes are grafted to netdev
> > queues. sch_htb expects the dev_queue field of these qdiscs to
> > point to
> > the corresponding queues. However, qdisc creation may fail, and in
> > that
> > case noop_qdisc is used instead. Its dev_queue doesn't point to the
> > right queue, so sch_htb can lose track of used netdev queues, which
> > will
> > cause internal inconsistencies.
> > 
> > This commit fixes this bug by keeping track of the netdev queue
> > inside
> > struct htb_class. All reads of cl->leaf.q->dev_queue are replaced
> > by the
> > new field, the two values are synced on writes, and WARNs are added
> > to
> > assert equality of the two values.
> > 
> > The driver API has changed: when TC_HTB_LEAF_DEL needs to move a
> > queue,
> > the driver used to pass the old and new queue IDs to sch_htb. Now
> > that
> > there is a new field (offload_queue) in struct htb_class that needs
> > to
> > be updated on this operation, the driver will pass the old class ID
> > to
> > sch_htb instead (it already knows the new class ID).
> > 
> > Fixes: d03b195b5aa0 ("sch_htb: Hierarchical QoS hardware offload")
> > Signed-off-by: Maxim Mikityanskiy <maximmi@...dia.com>
> > Reviewed-by: Tariq Toukan <tariqt@...dia.com>
> > ---
> >  .../net/ethernet/mellanox/mlx5/core/en/qos.c  | 15 ++-
> >  .../net/ethernet/mellanox/mlx5/core/en/qos.h  |  4 +-
> >  .../net/ethernet/mellanox/mlx5/core/en_main.c |  3 +-
> >  include/net/pkt_cls.h                         |  3 +-
> >  net/sched/sch_htb.c                           | 97 ++++++++++++---
> > ----
> >  5 files changed, 72 insertions(+), 50 deletions(-)
> 
> Having one patch touching net/sched and one driver looks odd.
> 
> I guess it is not possible to split it ?
> 

not really possible since API for the driver got changed
struct tc_htb_qopt_offload: removed moved_qid field.
we can minimize the driver code just to make it build, then implement
the proper support in a later patch, but what's the point, the driver
changes are pretty minimal.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ