History

Merge tag 'block-6.3-2023-03-09' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe: - Fix a regression in exclusive mode handling of the partition code, introduced in this merge windoe (Yu) - Fix for a use-after-free in BFQ (Yu) - Add sysfs documentation for the 'hidden' attribute (Sagi) * tag 'block-6.3-2023-03-09' of git://git.kernel.dk/linux: block, bfq: fix uaf for 'stable_merge_bfqq' docs: sysfs-block: document hidden sysfs entry block: fix wrong mode for blkdev_put() from disk_scan_partitions()

Linus Torvalds committed 3 years ago

Commit 40f879b2 parents d33d4c9 e2f2a393 files · +19 −10Browse files

Unified · Split

3 files
  1. Documentation/ABI/stable/sysfs-block +9 −0
  2. block/bfq-iosched.c +9 −9
  3. block/genhd.c +1 −1
Documentation/ABI/stable/sysfs-block+9−0
@@ -705,6 +705,15 @@ Description: · 704 unmodified lines
705 zoned will report "none".705 zoned will report "none".
706 706
707 707
708What: /sys/block/<disk>/hidden
709Date: March 2023
710Contact: linux-block@vger.kernel.org
711Description:
712 [RO] the block device is hidden. it doesn’t produce events, and
713 can’t be opened from userspace or using blkdev_get*.
714 Used for the underlying components of multipath devices.
715
716
708What: /sys/block/<disk>/stat717What: /sys/block/<disk>/stat
709Date: February 2008718Date: February 2008
710Contact: Jerome Marchand <jmarchan@redhat.com>719Contact: Jerome Marchand <jmarchan@redhat.com>
block/bfq-iosched.c+9−9
@@ -2854,11 +2854,11 @@ bfq_setup_stable_merge(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 2853 unmodified lines
2854{2854{
2855 int proc_ref = min(bfqq_process_refs(bfqq),2855 int proc_ref = min(bfqq_process_refs(bfqq),
2856 bfqq_process_refs(stable_merge_bfqq));2856 bfqq_process_refs(stable_merge_bfqq));
2857 struct bfq_queue *new_bfqq;2857 struct bfq_queue *new_bfqq = NULL;
2858 2858
2859 if (idling_boosts_thr_without_issues(bfqd, bfqq) ||2859 bfqq_data->stable_merge_bfqq = NULL;
2860 proc_ref == 0)2860 if (idling_boosts_thr_without_issues(bfqd, bfqq) || proc_ref == 0)
2861 return NULL;2861 goto out;
2862 2862
2863 /* next function will take at least one ref */2863 /* next function will take at least one ref */
2864 new_bfqq = bfq_setup_merge(bfqq, stable_merge_bfqq);2864 new_bfqq = bfq_setup_merge(bfqq, stable_merge_bfqq);
@@ -2873,6 +2873,11 @@ bfq_setup_stable_merge(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 8 unmodified lines
2873 new_bfqq_data->stably_merged = true;2873 new_bfqq_data->stably_merged = true;
2874 }2874 }
2875 }2875 }
2876
2877out:
2878 /* deschedule stable merge, because done or aborted here */
2879 bfq_put_stable_ref(stable_merge_bfqq);
2880
2876 return new_bfqq;2881 return new_bfqq;
2877}2882}
2878 2883
@@ -2933,11 +2938,6 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 54 unmodified lines
2933 struct bfq_queue *stable_merge_bfqq =2938 struct bfq_queue *stable_merge_bfqq =
2934 bfqq_data->stable_merge_bfqq;2939 bfqq_data->stable_merge_bfqq;
2935 2940
2936 /* deschedule stable merge, because done or aborted here */
2937 bfq_put_stable_ref(stable_merge_bfqq);
2938
2939 bfqq_data->stable_merge_bfqq = NULL;
2940
2941 return bfq_setup_stable_merge(bfqd, bfqq,2941 return bfq_setup_stable_merge(bfqd, bfqq,
2942 stable_merge_bfqq,2942 stable_merge_bfqq,
2943 bfqq_data);2943 bfqq_data);
block/genhd.c+1−1
@@ -385,7 +385,7 @@ int disk_scan_partitions(struct gendisk *disk, fmode_t mode) · 384 unmodified lines
385 if (IS_ERR(bdev))385 if (IS_ERR(bdev))
386 ret = PTR_ERR(bdev);386 ret = PTR_ERR(bdev);
387 else387 else
388 blkdev_put(bdev, mode);388 blkdev_put(bdev, mode & ~FMODE_EXCL);
389 389
390 if (!(mode & FMODE_EXCL))390 if (!(mode & FMODE_EXCL))
391 bd_abort_claiming(disk->part0, disk_scan_partitions);391 bd_abort_claiming(disk->part0, disk_scan_partitions);