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-next>] [day] [month] [year] [list]
Date:   Sat, 23 Sep 2017 17:04:24 +0800
From:   tanxiaofei <tanxiaofei@...wei.com>
To:     <tj@...nel.org>, <jiangshanlai@...il.com>,
        <linux-kernel@...r.kernel.org>
CC:     Linuxarm <linuxarm@...wei.com>
Subject: [Question] null pointer risk of kernel workqueue

Hi Tejun & Jiangshan,

I find an null pointer risk in the code of workqueue. Here is description:

If draining, __queue_work() will call the function is_chained_work() to do some checks.
In is_chained_work(), worker->current_pwq is used directly. It should be not safe.
http://elixir.free-electrons.com/linux/latest/source/kernel/workqueue.c#L1384

If you check the thread function of this worker, worker_thread(), you will find worker->current_pwq
is null when one work is done or ready to be processed.
This issue may happen only if we queue work during executing drain_workqueue().
http://elixir.free-electrons.com/linux/latest/source/kernel/workqueue.c#L2173

There are very few places to call drain_workqueue() in the whole linux kernel.
I think that's why no one noticed this risk.

Xiaofei Tan
_______________________________________________
linuxarm mailing list
linuxarm@...wei.com
http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm

.

Powered by blists - more mailing lists