mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Zhang Qiang <qiang.zhang@windriver.com>,
	Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v3] workqueue: Fix double kfree for rescuer
Date: Mon, 25 May 2020 12:01:59 +0200	[thread overview]
Message-ID: <7c320424-fb25-1c4a-3d52-5d381c7b2884@web.de> (raw)
In-Reply-To: <20200525093019.2253-1-qiang.zhang@windriver.com>

> The callback function "rcu_free_wq" could be called after memory
> was released for "rescuer" already, Thus delete a misplaced call
> of the function "kfree".

I got into the mood to follow your interpretation of the
software situation for a moment.

I have taken another look also at the implementation of the function “destroy_workqueue”.

* The function call “kfree(rescuer)” can be performed there in an if branch
  after the statement “wq->rescuer = NULL” was executed.

* This data processing is independent from a possible call of the
  function “call_rcu(&wq->rcu, rcu_free_wq)” in another if branch.
  Thus it seems that a null pointer is intentionally passed by a data structure
  member to this callback function on demand.
  The corresponding call of the function “kfree” can tolerate this special case.


Now I find that the proposed change can be inappropriate.
I'm sorry for undesirable confusion because of this patch review.

Regards,
Markus

  reply	other threads:[~2020-05-25 10:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25  9:30 qiang.zhang
2020-05-25 10:01 ` Markus Elfring [this message]
2020-05-25 10:01 ` Markus Elfring
2020-05-26  8:56 ` Lai Jiangshan
2020-05-26  9:11   ` [v3] " Markus Elfring
2020-05-26 10:04   ` [PATCH v3] " Zhang, Qiang
2020-05-26 10:34     ` [v3] " Markus Elfring

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=7c320424-fb25-1c4a-3d52-5d381c7b2884@web.de \
    --to=markus.elfring@web.de \
    --cc=jiangshanlai@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiang.zhang@windriver.com \
    --cc=tj@kernel.org \
    /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®