Skip to content

Commit a4165ff

Browse files
committed
Merge tag 'block-6.18-20251120' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull block fixes from Jens Axboe: "NVMe pull request via Keith: - Admin queue use-after-free fix (Keith) - Target authentication fix (Alistar) - Multipath lockdeup fix (Shin'ichiro) - FC transport teardown fixes (Ewan)" * tag 'block-6.18-20251120' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux: nvme: nvme-fc: Ensure ->ioerr_work is cancelled in nvme_fc_delete_ctrl() nvme: nvme-fc: move tagset removal to nvme_fc_delete_ctrl() nvme-multipath: fix lockdep WARN due to partition scan work nvmet-auth: update sc_c in target host hash calculation nvme: fix admin request_queue lifetime
2 parents 317c4d8 + 49c2d59 commit a4165ff

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

drivers/nvme/host/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4901,7 +4901,6 @@ void nvme_remove_admin_tag_set(struct nvme_ctrl *ctrl)
49014901
*/
49024902
nvme_stop_keep_alive(ctrl);
49034903
blk_mq_destroy_queue(ctrl->admin_q);
4904-
blk_put_queue(ctrl->admin_q);
49054904
if (ctrl->ops->flags & NVME_F_FABRICS) {
49064905
blk_mq_destroy_queue(ctrl->fabrics_q);
49074906
blk_put_queue(ctrl->fabrics_q);
@@ -5045,6 +5044,8 @@ static void nvme_free_ctrl(struct device *dev)
50455044
container_of(dev, struct nvme_ctrl, ctrl_device);
50465045
struct nvme_subsystem *subsys = ctrl->subsys;
50475046

5047+
if (ctrl->admin_q)
5048+
blk_put_queue(ctrl->admin_q);
50485049
if (!subsys || ctrl->instance != subsys->instance)
50495050
ida_free(&nvme_instance_ida, ctrl->instance);
50505051
nvme_free_cels(ctrl);

drivers/nvme/host/fc.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,17 +2355,11 @@ nvme_fc_ctrl_free(struct kref *ref)
23552355
container_of(ref, struct nvme_fc_ctrl, ref);
23562356
unsigned long flags;
23572357

2358-
if (ctrl->ctrl.tagset)
2359-
nvme_remove_io_tag_set(&ctrl->ctrl);
2360-
23612358
/* remove from rport list */
23622359
spin_lock_irqsave(&ctrl->rport->lock, flags);
23632360
list_del(&ctrl->ctrl_list);
23642361
spin_unlock_irqrestore(&ctrl->rport->lock, flags);
23652362

2366-
nvme_unquiesce_admin_queue(&ctrl->ctrl);
2367-
nvme_remove_admin_tag_set(&ctrl->ctrl);
2368-
23692363
kfree(ctrl->queues);
23702364

23712365
put_device(ctrl->dev);
@@ -3259,13 +3253,20 @@ nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
32593253
{
32603254
struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
32613255

3262-
cancel_work_sync(&ctrl->ioerr_work);
32633256
cancel_delayed_work_sync(&ctrl->connect_work);
3257+
32643258
/*
32653259
* kill the association on the link side. this will block
32663260
* waiting for io to terminate
32673261
*/
32683262
nvme_fc_delete_association(ctrl);
3263+
cancel_work_sync(&ctrl->ioerr_work);
3264+
3265+
if (ctrl->ctrl.tagset)
3266+
nvme_remove_io_tag_set(&ctrl->ctrl);
3267+
3268+
nvme_unquiesce_admin_queue(&ctrl->ctrl);
3269+
nvme_remove_admin_tag_set(&ctrl->ctrl);
32693270
}
32703271

32713272
static void

drivers/nvme/host/multipath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static void nvme_mpath_set_live(struct nvme_ns *ns)
793793
return;
794794
}
795795
nvme_add_ns_head_cdev(head);
796-
kblockd_schedule_work(&head->partition_scan_work);
796+
queue_work(nvme_wq, &head->partition_scan_work);
797797
}
798798

799799
nvme_mpath_add_sysfs_link(ns->head);

drivers/nvme/target/auth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ int nvmet_auth_host_hash(struct nvmet_req *req, u8 *response,
298298
const char *hash_name;
299299
u8 *challenge = req->sq->dhchap_c1;
300300
struct nvme_dhchap_key *transformed_key;
301-
u8 buf[4], sc_c = ctrl->concat ? 1 : 0;
301+
u8 buf[4];
302302
int ret;
303303

304304
hash_name = nvme_auth_hmac_name(ctrl->shash_id);
@@ -367,7 +367,7 @@ int nvmet_auth_host_hash(struct nvmet_req *req, u8 *response,
367367
ret = crypto_shash_update(shash, buf, 2);
368368
if (ret)
369369
goto out;
370-
*buf = sc_c;
370+
*buf = req->sq->sc_c;
371371
ret = crypto_shash_update(shash, buf, 1);
372372
if (ret)
373373
goto out;

drivers/nvme/target/fabrics-cmd-auth.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static u8 nvmet_auth_negotiate(struct nvmet_req *req, void *d)
4343
data->auth_protocol[0].dhchap.halen,
4444
data->auth_protocol[0].dhchap.dhlen);
4545
req->sq->dhchap_tid = le16_to_cpu(data->t_id);
46+
req->sq->sc_c = data->sc_c;
4647
if (data->sc_c != NVME_AUTH_SECP_NOSC) {
4748
if (!IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS))
4849
return NVME_AUTH_DHCHAP_FAILURE_CONCAT_MISMATCH;

drivers/nvme/target/nvmet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ struct nvmet_sq {
159159
bool authenticated;
160160
struct delayed_work auth_expired_work;
161161
u16 dhchap_tid;
162+
u8 sc_c;
162163
u8 dhchap_status;
163164
u8 dhchap_step;
164165
u8 *dhchap_c1;

0 commit comments

Comments
 (0)