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:   Mon, 18 Feb 2019 14:39:21 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     Eric Dumazet <edumazet@...gle.com>
CC:     netdev <netdev@...r.kernel.org>,
        Willem de Bruijn <willemb@...gle.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jay Vosburgh <j.vosburgh@...il.com>,
        Veaceslav Falico <vfalico@...il.com>, <weiyongjun1@...wei.com>
Subject: Re: [RFC PATCH] bonding: use mutex lock in bond_get_stats()


On 2019/2/17 2:18, Eric Dumazet wrote:
> On Fri, Feb 15, 2019 at 9:36 PM Kefeng Wang <wangkefeng.wang@...wei.com> wrote:
>>
>>
>> On 2019/2/15 21:57, Eric Dumazet wrote:
>>> On Fri, Feb 15, 2019 at 5:37 AM Kefeng Wang <wangkefeng.wang@...wei.com> wrote:
>>>> With CONFIG_DEBUG_SPINLOCK=y, we find following stack,
>>>>
>>>>  BUG: spinlock wrong CPU on CPU#0, ip/16047
>>>>   lock: 0xffff803f5febc998, .magic: dead4ead, .owner: ip/16047, .owner_cpu: 0
>>>>  CPU: 1 PID: 16047 Comm: ip Kdump: loaded Tainted: G            E 4.19.12.aarch64 #1
>>>>  Hardware name: Huawei TaiShan 2280 V2/BC82AMDA, BIOS TA BIOS TaiShan 2280 V2 - B900 01/29/2019
>>>>  Call trace:
>>>>   dump_backtrace+0x0/0x1c0
>>>>   show_stack+0x24/0x30
>>>>   dump_stack+0x90/0xbc
>>>>   spin_dump+0x84/0xa8
>>>>   do_raw_spin_unlock+0xf8/0x100
>>>>   _raw_spin_unlock+0x20/0x30
>>>>   bond_get_stats+0x110/0x140 [bonding]
>>>>   rtnl_fill_stats+0x50/0x150
>>>>   rtnl_fill_ifinfo+0x4d4/0xd18
>>>>   rtnl_dump_ifinfo+0x200/0x3a8
>>>>   netlink_dump+0x100/0x2b0
>>>>   netlink_recvmsg+0x310/0x3e8
>>>>   sock_recvmsg+0x58/0x68
>>>>   ___sys_recvmsg+0xd0/0x278
>>>>   __sys_recvmsg+0x74/0xd0
>>>>   __arm64_sys_recvmsg+0x2c/0x38
>>>>   el0_svc_common+0x7c/0x118
>>>>   el0_svc_handler+0x30/0x40
>>>>   el0_svc+0x8/0xc
>>>>
>>>> and then lead to softlockup issue, fix this by using mutex lock instead
>>>> of spin lock.
>>>>
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
>>>> ---
>>>>
>>>> Not sure if this is right fix, please correct me if I'm wrong.
>>>>
>>> Make sure to also try :
>>>
>>> cat /proc/net/dev
>> Yes, no regression with this patch in our test or 'cat /proc/net/dev'
>>
> You really should have a warning showing up.
>
> Make sure you have : DEBUG_ATOMIC_SLEEP=y  (I thought this was
> automatically selected with LOCKDEP on, maybe not...)
>
> Please take a look at net/core/net-procfs.c , functions
> dev_seq_start(), dev_seq_printf_stats(), dev_seq_show()
>
> We can not use a mutex in a section protected by rcu_read_lock()

ok, thanks for your direction, we will do more research and test.

> .
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ