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]
Date:   Tue, 07 Jul 2020 17:25:08 +0200
From:   Petr Machata <petrm@...lanox.com>
To:     Cong Wang <xiyou.wangcong@...il.com>
Cc:     Linux Kernel Network Developers <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Jiri Pirko <jiri@...lanox.com>,
        Ido Schimmel <idosch@...lanox.com>
Subject: Re: [PATCH net-next v1 1/5] net: sched: Pass root lock to Qdisc_ops.enqueue


Cong Wang <xiyou.wangcong@...il.com> writes:

> On Fri, Jun 26, 2020 at 3:46 PM Petr Machata <petrm@...lanox.com> wrote:
>>
>> A following patch introduces qevents, points in qdisc algorithm where
>> packet can be processed by user-defined filters. Should this processing
>> lead to a situation where a new packet is to be enqueued on the same port,
>> holding the root lock would lead to deadlocks. To solve the issue, qevent
>> handler needs to unlock and relock the root lock when necessary.
>>
>> To that end, add the root lock argument to the qdisc op enqueue, and
>> propagate throughout.
>
> Hmm, but why do you pass root lock down to each ->enqueue()?
>
> You can find root lock with sch_tree_lock() (or qdisc_lock() if you don't
> care about hierarchy), and you already have qdisc as a parameter of
> tcf_qevent_handle().

I know, I wanted to make it clear that the lock may end up being used,
instead of doing it "stealthily". If you find this inelegant I can push
a follow-up that converts tcf_qevent_handle() to sch_tree_unlock().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ