Skip to content

Commit 50eb0a0

Browse files
committed
Merge tag 'block-5.15-2021-10-09' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Two small fixes for this release: - Add missing QUEUE_FLAG_HCTX_ACTIVE in the debugfs handling (Johannes) - Fix double free / UAF issue in __alloc_disk_node (Tetsuo)" * tag 'block-5.15-2021-10-09' of git://git.kernel.dk/linux-block: block: decode QUEUE_FLAG_HCTX_ACTIVE in debugfs output block: genhd: fix double kfree() in __alloc_disk_node()
2 parents c75de84 + 1dbdd99 commit 50eb0a0

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

block/bdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,14 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno)
490490
bdev = I_BDEV(inode);
491491
mutex_init(&bdev->bd_fsfreeze_mutex);
492492
spin_lock_init(&bdev->bd_size_lock);
493-
bdev->bd_disk = disk;
494493
bdev->bd_partno = partno;
495494
bdev->bd_inode = inode;
496495
bdev->bd_stats = alloc_percpu(struct disk_stats);
497496
if (!bdev->bd_stats) {
498497
iput(inode);
499498
return NULL;
500499
}
500+
bdev->bd_disk = disk;
501501
return bdev;
502502
}
503503

block/blk-mq-debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static const char *const blk_queue_flag_name[] = {
129129
QUEUE_FLAG_NAME(PCI_P2PDMA),
130130
QUEUE_FLAG_NAME(ZONE_RESETALL),
131131
QUEUE_FLAG_NAME(RQ_ALLOC_TIME),
132+
QUEUE_FLAG_NAME(HCTX_ACTIVE),
132133
QUEUE_FLAG_NAME(NOWAIT),
133134
};
134135
#undef QUEUE_FLAG_NAME

block/genhd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,7 @@ struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id,
12681268

12691269
out_destroy_part_tbl:
12701270
xa_destroy(&disk->part_tbl);
1271+
disk->part0->bd_disk = NULL;
12711272
iput(disk->part0->bd_inode);
12721273
out_free_bdi:
12731274
bdi_put(disk->bdi);

0 commit comments

Comments
 (0)