Re: [PATCH v2] writeback, cgroup: fix null-ptr-deref write in bdi_split_work_to_wbs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023/4/11 11:53, Andrew Morton wrote:
On Mon, 10 Apr 2023 21:08:26 +0800 Baokun Li <libaokun1@xxxxxxxxxx> 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
.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux