nvme-auth: check chap ctrl_key once constructed
ctrl ctrl_key member may be overwritten from a sysfs context driven by the user. Once a queue local copy was created, use that instead to minimize checks on a shared resource. Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
e8a420efb6
commit
546dea18c9
1 changed files with 2 additions and 2 deletions
|
@ -333,7 +333,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl,
|
||||||
struct nvmf_auth_dhchap_success1_data *data = chap->buf;
|
struct nvmf_auth_dhchap_success1_data *data = chap->buf;
|
||||||
size_t size = sizeof(*data);
|
size_t size = sizeof(*data);
|
||||||
|
|
||||||
if (ctrl->ctrl_key)
|
if (chap->ctrl_key)
|
||||||
size += chap->hash_len;
|
size += chap->hash_len;
|
||||||
|
|
||||||
if (size > CHAP_BUF_SIZE) {
|
if (size > CHAP_BUF_SIZE) {
|
||||||
|
@ -811,7 +811,7 @@ static void nvme_queue_auth_work(struct work_struct *work)
|
||||||
goto fail2;
|
goto fail2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctrl->ctrl_key) {
|
if (chap->ctrl_key) {
|
||||||
/* DH-HMAC-CHAP Step 5: send success2 */
|
/* DH-HMAC-CHAP Step 5: send success2 */
|
||||||
dev_dbg(ctrl->device, "%s: qid %d send success2\n",
|
dev_dbg(ctrl->device, "%s: qid %d send success2\n",
|
||||||
__func__, chap->qid);
|
__func__, chap->qid);
|
||||||
|
|
Loading…
Add table
Reference in a new issue