mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Libin <huawei.libin@huawei.com>
Cc: linux-kernel@vger.kernel.org, wangyijing@huawei.com,
	guohanjun@huawei.com
Subject: Re: [PATCH] workqueue: fix pool ID allocation leakage and remove BUILD_BUG_ON() in init_workqueues
Date: Mon, 9 Sep 2013 21:59:26 -0400	[thread overview]
Message-ID: <20130910015926.GA23584@mtj.dyndns.org> (raw)
In-Reply-To: <1378777955-8264-1-git-send-email-huawei.libin@huawei.com>

On Tue, Sep 10, 2013 at 09:52:35AM +0800, Libin wrote:
> From: Li Bin <huawei.libin@huawei.com>
> 
> 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.
> 
> Signed-off-by: Li Bin <huawei.libin@huawei.com>

Applied to wq/for-3.12-fixes w/ minor updates.

Thanks.

-- 
tejun

      reply	other threads:[~2013-09-10  1:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10  1:52 Libin
2013-09-10  1:59 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130910015926.GA23584@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=guohanjun@huawei.com \
    --cc=huawei.libin@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangyijing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®