[<prev] [next>] [day] [month] [year] [list]
Message-ID: <b45e662b-b50f-a23b-a123-e1454daf20ed@163.com>
Date: Fri, 11 Jan 2019 10:11:56 +0800
From: Jia-Ju Bai <baijiaju1990@....com>
To: aviad.krawczyk@...wei.com
Cc: netdev <netdev@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [BUG] net: huawei: hinic: a possible sleep-in-atomic-context bug in
hinic_get_stats64
The driver may sleep while holding a RCU lock.
The function call path (from bottom to top) in Linux-4.17 is:
[FUNC] down
drivers/net/.../hinic/hinic_main.c, 775: down in hinic_get_stats64
net/core/dev.c, 8278: [FUNC_PTR]hinic_get_stats64 in dev_get_stats
net/core/net-sysfs.c, 568: dev_get_stats in netstat_show
net/core/net-sysfs.c, 565: _raw_read_lock in netstat_show
Note that [FUNC_PTR] means a function pointer call.
This bug is found by my static analysis tool (DSAC-2) and checked by my
manual code review.
I do not know how to correctly fix this bug, so I just report it.
A possible way may be to replace up() and down()
with spin_lock() and spin_unlock().
Best wishes,
Jia-Ju Bai
Powered by blists - more mailing lists