nvme-auth: clear sensitive info right after authentication completes
authorSagi Grimberg <sagi@grimberg.me>
Sun, 13 Nov 2022 11:24:15 +0000 (13:24 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 16 Nov 2022 07:36:35 +0000 (08:36 +0100)
We don't want to keep authentication sensitive info in memory for unlimited
amount of time.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/auth.c

index 1b44676..04cf183 100644 (file)
@@ -912,6 +912,8 @@ int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid)
                mutex_unlock(&ctrl->dhchap_auth_mutex);
                flush_work(&chap->auth_work);
                ret = chap->error;
+               /* clear sensitive info */
+               nvme_auth_reset_dhchap(chap);
                return ret;
        }
        mutex_unlock(&ctrl->dhchap_auth_mutex);