+++ /dev/null
-From 09f871868080c33992cd6a9b72a5ca49582578fa Mon Sep 17 00:00:00 2001
-From: Jan Kara <jack@suse.cz>
-Date: Fri, 1 Apr 2022 12:27:48 +0200
-Subject: bfq: Track whether bfq_group is still online
-
-From: Jan Kara <jack@suse.cz>
-
-commit 09f871868080c33992cd6a9b72a5ca49582578fa upstream.
-
-Track whether bfq_group is still online. We cannot rely on
-blkcg_gq->online because that gets cleared only after all policies are
-offlined and we need something that gets updated already under
-bfqd->lock when we are cleaning up our bfq_group to be able to guarantee
-that when we see online bfq_group, it will stay online while we are
-holding bfqd->lock lock.
-
-CC: stable@vger.kernel.org
-Tested-by: "yukuai (C)" <yukuai3@huawei.com>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christoph Hellwig <hch@lst.de>
-Link: https://lore.kernel.org/r/20220401102752.8599-7-jack@suse.cz
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- block/bfq-cgroup.c | 3 ++-
- block/bfq-iosched.h | 2 ++
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/block/bfq-cgroup.c
-+++ b/block/bfq-cgroup.c
-@@ -442,6 +442,7 @@ static void bfq_pd_init(struct blkg_poli
- */
- bfqg->bfqd = bfqd;
- bfqg->active_entities = 0;
-+ bfqg->online = true;
- bfqg->rq_pos_tree = RB_ROOT;
- }
-
-@@ -488,7 +489,6 @@ struct bfq_group *bfq_find_set_group(str
- struct bfq_entity *entity;
-
- bfqg = bfq_lookup_bfqg(bfqd, blkcg);
--
- if (unlikely(!bfqg))
- return NULL;
-
-@@ -788,6 +788,7 @@ static void bfq_pd_offline(struct blkg_p
-
- put_async_queues:
- bfq_put_async_queues(bfqd, bfqg);
-+ bfqg->online = false;
-
- spin_unlock_irqrestore(&bfqd->lock, flags);
- /*
---- a/block/bfq-iosched.h
-+++ b/block/bfq-iosched.h
-@@ -776,6 +776,8 @@ struct bfq_group {
-
- /* reference counter (see comments in bfq_bic_update_cgroup) */
- int ref;
-+ /* Is bfq_group still online? */
-+ bool online;
-
- struct bfq_entity entity;
- struct bfq_sched_data sched_data;
+++ /dev/null
-From ea591cd4eb270393810e7be01feb8fde6a34fbbe Mon Sep 17 00:00:00 2001
-From: Jan Kara <jack@suse.cz>
-Date: Fri, 1 Apr 2022 12:27:45 +0200
-Subject: bfq: Update cgroup information before merging bio
-
-From: Jan Kara <jack@suse.cz>
-
-commit ea591cd4eb270393810e7be01feb8fde6a34fbbe upstream.
-
-When the process is migrated to a different cgroup (or in case of
-writeback just starts submitting bios associated with a different
-cgroup) bfq_merge_bio() can operate with stale cgroup information in
-bic. Thus the bio can be merged to a request from a different cgroup or
-it can result in merging of bfqqs for different cgroups or bfqqs of
-already dead cgroups and causing possible use-after-free issues. Fix the
-problem by updating cgroup information in bfq_merge_bio().
-
-CC: stable@vger.kernel.org
-Fixes: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support")
-Tested-by: "yukuai (C)" <yukuai3@huawei.com>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christoph Hellwig <hch@lst.de>
-Link: https://lore.kernel.org/r/20220401102752.8599-4-jack@suse.cz
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- block/bfq-iosched.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
---- a/block/bfq-iosched.c
-+++ b/block/bfq-iosched.c
-@@ -1638,10 +1638,17 @@ static bool bfq_bio_merge(struct blk_mq_
-
- spin_lock_irq(&bfqd->lock);
-
-- if (bic)
-+ if (bic) {
-+ /*
-+ * Make sure cgroup info is uptodate for current process before
-+ * considering the merge.
-+ */
-+ bfq_bic_update_cgroup(bic, bio);
-+
- bfqd->bio_bfqq = bic_to_bfqq(bic, op_is_sync(bio->bi_opf));
-- else
-+ } else {
- bfqd->bio_bfqq = NULL;
-+ }
- bfqd->bio_bic = bic;
-
- ret = blk_mq_sched_try_merge(q, bio, &free);
wifi-mac80211-fix-use-after-free-in-chanctx-code.patch
iwlwifi-mvm-fix-assert-1f04-upon-reconfig.patch
fs-writeback-writeback_sb_inodes-recalculate-wrote-according-skipped-pages.patch
-bfq-update-cgroup-information-before-merging-bio.patch
-bfq-track-whether-bfq_group-is-still-online.patch
ext4-fix-use-after-free-in-ext4_rename_dir_prepare.patch
ext4-fix-bug_on-in-ext4_writepages.patch
ext4-verify-dir-block-before-splitting-it.patch
+++ /dev/null
-From 09f871868080c33992cd6a9b72a5ca49582578fa Mon Sep 17 00:00:00 2001
-From: Jan Kara <jack@suse.cz>
-Date: Fri, 1 Apr 2022 12:27:48 +0200
-Subject: bfq: Track whether bfq_group is still online
-
-From: Jan Kara <jack@suse.cz>
-
-commit 09f871868080c33992cd6a9b72a5ca49582578fa upstream.
-
-Track whether bfq_group is still online. We cannot rely on
-blkcg_gq->online because that gets cleared only after all policies are
-offlined and we need something that gets updated already under
-bfqd->lock when we are cleaning up our bfq_group to be able to guarantee
-that when we see online bfq_group, it will stay online while we are
-holding bfqd->lock lock.
-
-CC: stable@vger.kernel.org
-Tested-by: "yukuai (C)" <yukuai3@huawei.com>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christoph Hellwig <hch@lst.de>
-Link: https://lore.kernel.org/r/20220401102752.8599-7-jack@suse.cz
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- block/bfq-cgroup.c | 3 ++-
- block/bfq-iosched.h | 2 ++
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/block/bfq-cgroup.c
-+++ b/block/bfq-cgroup.c
-@@ -468,6 +468,7 @@ static void bfq_pd_init(struct blkg_poli
- */
- bfqg->bfqd = bfqd;
- bfqg->active_entities = 0;
-+ bfqg->online = true;
- bfqg->rq_pos_tree = RB_ROOT;
- }
-
-@@ -514,7 +515,6 @@ struct bfq_group *bfq_find_set_group(str
- struct bfq_entity *entity;
-
- bfqg = bfq_lookup_bfqg(bfqd, blkcg);
--
- if (unlikely(!bfqg))
- return NULL;
-
-@@ -814,6 +814,7 @@ static void bfq_pd_offline(struct blkg_p
-
- put_async_queues:
- bfq_put_async_queues(bfqd, bfqg);
-+ bfqg->online = false;
-
- spin_unlock_irqrestore(&bfqd->lock, flags);
- /*
---- a/block/bfq-iosched.h
-+++ b/block/bfq-iosched.h
-@@ -854,6 +854,8 @@ struct bfq_group {
-
- /* reference counter (see comments in bfq_bic_update_cgroup) */
- int ref;
-+ /* Is bfq_group still online? */
-+ bool online;
-
- struct bfq_entity entity;
- struct bfq_sched_data sched_data;
+++ /dev/null
-From ea591cd4eb270393810e7be01feb8fde6a34fbbe Mon Sep 17 00:00:00 2001
-From: Jan Kara <jack@suse.cz>
-Date: Fri, 1 Apr 2022 12:27:45 +0200
-Subject: bfq: Update cgroup information before merging bio
-
-From: Jan Kara <jack@suse.cz>
-
-commit ea591cd4eb270393810e7be01feb8fde6a34fbbe upstream.
-
-When the process is migrated to a different cgroup (or in case of
-writeback just starts submitting bios associated with a different
-cgroup) bfq_merge_bio() can operate with stale cgroup information in
-bic. Thus the bio can be merged to a request from a different cgroup or
-it can result in merging of bfqqs for different cgroups or bfqqs of
-already dead cgroups and causing possible use-after-free issues. Fix the
-problem by updating cgroup information in bfq_merge_bio().
-
-CC: stable@vger.kernel.org
-Fixes: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support")
-Tested-by: "yukuai (C)" <yukuai3@huawei.com>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christoph Hellwig <hch@lst.de>
-Link: https://lore.kernel.org/r/20220401102752.8599-4-jack@suse.cz
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- block/bfq-iosched.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
---- a/block/bfq-iosched.c
-+++ b/block/bfq-iosched.c
-@@ -1864,10 +1864,17 @@ static bool bfq_bio_merge(struct blk_mq_
-
- spin_lock_irq(&bfqd->lock);
-
-- if (bic)
-+ if (bic) {
-+ /*
-+ * Make sure cgroup info is uptodate for current process before
-+ * considering the merge.
-+ */
-+ bfq_bic_update_cgroup(bic, bio);
-+
- bfqd->bio_bfqq = bic_to_bfqq(bic, op_is_sync(bio->bi_opf));
-- else
-+ } else {
- bfqd->bio_bfqq = NULL;
-+ }
- bfqd->bio_bic = bic;
-
- ret = blk_mq_sched_try_merge(q, bio, &free);
wifi-mac80211-fix-use-after-free-in-chanctx-code.patch
iwlwifi-mvm-fix-assert-1f04-upon-reconfig.patch
fs-writeback-writeback_sb_inodes-recalculate-wrote-according-skipped-pages.patch
-bfq-update-cgroup-information-before-merging-bio.patch
-bfq-track-whether-bfq_group-is-still-online.patch
netfilter-nf_tables-disallow-non-stateful-expression-in-sets-earlier.patch
ext4-fix-use-after-free-in-ext4_rename_dir_prepare.patch
ext4-fix-bug_on-in-ext4_writepages.patch