mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baokun Li <libaokun1@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-fsdevel@vger.kernel.org>, <viro@zeniv.linux.org.uk>,
	<brauner@kernel.org>, <jack@suse.cz>, <tj@kernel.org>,
	<dennis@kernel.org>, <adilger.kernel@dilger.ca>,
	<linux-kernel@vger.kernel.org>, <yi.zhang@huawei.com>,
	<yangerkun@huawei.com>, <houtao1@huawei.com>,
	<stable@vger.kernel.org>, Baokun Li <libaokun1@huawei.com>
Subject: Re: [PATCH v2] writeback, cgroup: fix null-ptr-deref write in bdi_split_work_to_wbs
Date: Tue, 11 Apr 2023 12:09:17 +0800	[thread overview]
Message-ID: <f58a438f-12e2-b3e2-2397-88a56e29d2b3@huawei.com> (raw)
In-Reply-To: <20230410205317.dcb186166b9603eeb876dfda@linux-foundation.org>

On 2023/4/11 11:53, Andrew Morton wrote:
> On Mon, 10 Apr 2023 21:08:26 +0800 Baokun Li <libaokun1@huawei.com> wrote:
>
>> ...
>>
>> To solve this problem, percpu_ref_exit() is called under RCU protection
>> to avoid race between cgwb_release_workfn() and bdi_split_work_to_wbs().
>> Moreover, replace wb_get() with wb_tryget() in bdi_split_work_to_wbs(),
>> and skip the current wb if wb_tryget() fails because the wb has already
>> been shutdown.
>>
>> Fixes: b817525a4a80 ("writeback: bdi_writeback iteration must not skip dying ones")
>> Fixes: f3b6a6df38aa ("writeback, cgroup: keep list of inodes attached to bdi_writeback")
> Two Fixes: is awkward.  The Fixes: serves a guide to which kernel
> versions should be patched, but those two commits are six years apart.
>
> So... how far back should this fix be backported?
This issue was introduced in v4.3-rc7 by commit b817525a4a80 
("writeback: bdi_writeback iteration
must not skip dying ones"), so anything that has this commit 
incorporated is problematic.

Another fix tag patch invalidates a previously unintentional fix, and 
then the problem becomes more
easily reproducible. This fix tag can actually be removed, and is added 
here so that people who see
the patch will know what happened.

-- 
With Best Regards,
Baokun Li
.

  reply	other threads:[~2023-04-11  4:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 13:08 Baokun Li
2023-04-11  3:53 ` Andrew Morton
2023-04-11  4:09   ` Baokun Li [this message]
2023-04-11 10:08 ` Jan Kara
2023-04-12 17:00 ` Tejun Heo
2023-05-03  0:17 ` Andrew Morton
2023-05-03 22:01   ` Roman Gushchin
2023-05-04  2:29   ` Baokun Li

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=f58a438f-12e2-b3e2-2397-88a56e29d2b3@huawei.com \
    --to=libaokun1@huawei.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=dennis@kernel.org \
    --cc=houtao1@huawei.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@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®