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:   Wed, 21 Feb 2018 11:30:36 +0300
From:   Kirill Tkhai <ktkhai@...tuozzo.com>
To:     Cong Wang <xiyou.wangcong@...il.com>
Cc:     David Miller <davem@...emloft.net>,
        Nicolas Dichtel <nicolas.dichtel@...nd.com>,
        vyasevic@...hat.com,
        "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
        Vladislav Yasevich <vyasevich@...il.com>, mark.rutland@....com,
        Greg KH <gregkh@...uxfoundation.org>, leonro@...lanox.com,
        avagin@...tuozzo.com, Florian Westphal <fw@...len.de>,
        roman.kapl@...go.com,
        Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/3] net: Make cleanup_list and net::cleanup_list of llist
 type

On 20.02.2018 22:42, Cong Wang wrote:
> On Mon, Feb 19, 2018 at 1:58 AM, Kirill Tkhai <ktkhai@...tuozzo.com> wrote:
>>  void __put_net(struct net *net)
>>  {
>>         /* Cleanup the network namespace in process context */
>> -       unsigned long flags;
>> -
>> -       spin_lock_irqsave(&cleanup_list_lock, flags);
>> -       list_add(&net->cleanup_list, &cleanup_list);
>> -       spin_unlock_irqrestore(&cleanup_list_lock, flags);
>> -
>> +       llist_add(&net->cleanup_list, &cleanup_list);
>>         queue_work(netns_wq, &net_cleanup_work);
>>  }
> 
> Is llist safe against IRQ too?

Yes, it's safe and it's aimed for the cases like this. There is no "locked"
state like spinlock has, there is single cmpxchg().

You may find examples it's used in ./kernel directory.

Kirill

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ