diff options
author | Li Bin <huawei.libin@huawei.com> | 2013-09-10 01:52:35 (GMT) |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-11-22 23:14:47 (GMT) |
commit | 4e8b22bd1a37447712f1b1d96352fc53b463c6b3 (patch) | |
tree | acc56d30147d1276c85e1ff602ba36c96fda20a4 /drivers/oprofile | |
parent | 9ef28a73ff6a1598d6f915973c282fe28291f800 (diff) | |
download | linux-fsl-qoriq-4e8b22bd1a37447712f1b1d96352fc53b463c6b3.tar.xz |
workqueue: fix pool ID allocation leakage and remove BUILD_BUG_ON() in init_workqueues
When one work starts execution, the high bits of work's data contain
pool ID. It can represent a maximum of WORK_OFFQ_POOL_NONE. Pool ID
is assigned WORK_OFFQ_POOL_NONE when the work being initialized
indicating that no pool is associated and get_work_pool() uses it to
check the associated pool. So if worker_pool_assign_id() assigns a
ID greater than or equal WORK_OFFQ_POOL_NONE to a pool, it triggers
leakage, and it may break the non-reentrance guarantee.
This patch fix this issue by modifying the worker_pool_assign_id()
function calling idr_alloc() by setting @end param WORK_OFFQ_POOL_NONE.
Furthermore, in the current implementation, the BUILD_BUG_ON() in
init_workqueues makes no sense. The number of worker pools needed
cannot be determined at compile time, because the number of backing
pools for UNBOUND workqueues is dynamic based on the assigned custom
attributes. So remove it.
tj: Minor comment and indentation updates.
Signed-off-by: Li Bin <huawei.libin@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/oprofile')
0 files changed, 0 insertions, 0 deletions