All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth
@ 2022-07-18 23:12 Chaitanya Kulkarni
  2022-07-18 23:12 ` [PATCH 1/2] nvmet: fix return value check in auth send Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-07-18 23:12 UTC (permalink / raw)
  To: hare; +Cc: linux-nvme, hch, sagi, Chaitanya Kulkarni


Hi,

Couple of type mismatch fixes for nvmet-auth reported by
Dan Carpenter.

-ck

Chaitanya Kulkarni (2):
  nvmet: fix return value check in auth send
  nvmet: fix return value check in auth receive

 drivers/nvme/target/fabrics-cmd-auth.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

-- 
2.29.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] nvmet: fix return value check in auth send
  2022-07-18 23:12 [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth Chaitanya Kulkarni
@ 2022-07-18 23:12 ` Chaitanya Kulkarni
  2022-07-19  6:51   ` Hannes Reinecke
  2022-07-21  5:41   ` Christoph Hellwig
  2022-07-18 23:12 ` [PATCH 2/2] nvmet: fix return value check in auth receive Chaitanya Kulkarni
  2022-07-21 22:15 ` [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth Sagi Grimberg
  2 siblings, 2 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-07-18 23:12 UTC (permalink / raw)
  To: hare; +Cc: linux-nvme, hch, sagi, Chaitanya Kulkarni, Dan Carpenter

nvmet_setup_auth() return type is int and currently it uses status
variable that is of type u16 in nvmet_execute_auth_send().

Catch the return value of nvmet_setup_auth() into int and set the
NVME_SC_INTERNAL as status variable before we jump to error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/target/fabrics-cmd-auth.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index cc56e8c821ce..f1c9c2f51afb 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -247,8 +247,10 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
 			pr_debug("%s: ctrl %d qid %d reset negotiation\n", __func__,
 				 ctrl->cntlid, req->sq->qid);
 			if (!req->sq->qid) {
-				status = nvmet_setup_auth(ctrl);
-				if (status < 0) {
+				int ret = nvmet_setup_auth(ctrl);
+
+				if (ret < 0) {
+					status = NVME_SC_INTERNAL;
 					pr_err("ctrl %d qid 0 failed to setup"
 					       "re-authentication",
 					       ctrl->cntlid);
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] nvmet: fix return value check in auth receive
  2022-07-18 23:12 [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth Chaitanya Kulkarni
  2022-07-18 23:12 ` [PATCH 1/2] nvmet: fix return value check in auth send Chaitanya Kulkarni
@ 2022-07-18 23:12 ` Chaitanya Kulkarni
  2022-07-19  6:51   ` Hannes Reinecke
  2022-07-21 22:15 ` [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth Sagi Grimberg
  2 siblings, 1 reply; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-07-18 23:12 UTC (permalink / raw)
  To: hare; +Cc: linux-nvme, hch, sagi, Chaitanya Kulkarni, Dan Carpenter

nvmet_auth_challenge() return type is int and currently it uses status
variable that is of type u16 in nvmet_execute_auth_receive().

Catch the return value of nvmet_auth_challenge() into int and set the
NVME_SC_INTERNAL as status variable before we jump to error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/target/fabrics-cmd-auth.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index f1c9c2f51afb..45056e204dde 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -486,8 +486,9 @@ void nvmet_execute_auth_receive(struct nvmet_req *req)
 		 ctrl->cntlid, req->sq->qid, req->sq->dhchap_step);
 	switch (req->sq->dhchap_step) {
 	case NVME_AUTH_DHCHAP_MESSAGE_CHALLENGE:
-		status = nvmet_auth_challenge(req, d, al);
-		if (status < 0) {
+		int ret = nvmet_auth_challenge(req, d, al);
+
+		if (ret < 0) {
 			pr_warn("ctrl %d qid %d: challenge error (%d)\n",
 				ctrl->cntlid, req->sq->qid, status);
 			status = NVME_SC_INTERNAL;
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] nvmet: fix return value check in auth send
  2022-07-18 23:12 ` [PATCH 1/2] nvmet: fix return value check in auth send Chaitanya Kulkarni
@ 2022-07-19  6:51   ` Hannes Reinecke
  2022-07-21  5:41   ` Christoph Hellwig
  1 sibling, 0 replies; 7+ messages in thread
From: Hannes Reinecke @ 2022-07-19  6:51 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, hch, sagi, Dan Carpenter

On 7/19/22 01:12, Chaitanya Kulkarni wrote:
> nvmet_setup_auth() return type is int and currently it uses status
> variable that is of type u16 in nvmet_execute_auth_send().
> 
> Catch the return value of nvmet_setup_auth() into int and set the
> NVME_SC_INTERNAL as status variable before we jump to error.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> ---
>   drivers/nvme/target/fabrics-cmd-auth.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
> index cc56e8c821ce..f1c9c2f51afb 100644
> --- a/drivers/nvme/target/fabrics-cmd-auth.c
> +++ b/drivers/nvme/target/fabrics-cmd-auth.c
> @@ -247,8 +247,10 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
>   			pr_debug("%s: ctrl %d qid %d reset negotiation\n", __func__,
>   				 ctrl->cntlid, req->sq->qid);
>   			if (!req->sq->qid) {
> -				status = nvmet_setup_auth(ctrl);
> -				if (status < 0) {
> +				int ret = nvmet_setup_auth(ctrl);
> +
> +				if (ret < 0) {
> +					status = NVME_SC_INTERNAL;
>   					pr_err("ctrl %d qid 0 failed to setup"
>   					       "re-authentication",
>   					       ctrl->cntlid);

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] nvmet: fix return value check in auth receive
  2022-07-18 23:12 ` [PATCH 2/2] nvmet: fix return value check in auth receive Chaitanya Kulkarni
@ 2022-07-19  6:51   ` Hannes Reinecke
  0 siblings, 0 replies; 7+ messages in thread
From: Hannes Reinecke @ 2022-07-19  6:51 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, hch, sagi, Dan Carpenter

On 7/19/22 01:12, Chaitanya Kulkarni wrote:
> nvmet_auth_challenge() return type is int and currently it uses status
> variable that is of type u16 in nvmet_execute_auth_receive().
> 
> Catch the return value of nvmet_auth_challenge() into int and set the
> NVME_SC_INTERNAL as status variable before we jump to error.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> ---
>   drivers/nvme/target/fabrics-cmd-auth.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
> index f1c9c2f51afb..45056e204dde 100644
> --- a/drivers/nvme/target/fabrics-cmd-auth.c
> +++ b/drivers/nvme/target/fabrics-cmd-auth.c
> @@ -486,8 +486,9 @@ void nvmet_execute_auth_receive(struct nvmet_req *req)
>   		 ctrl->cntlid, req->sq->qid, req->sq->dhchap_step);
>   	switch (req->sq->dhchap_step) {
>   	case NVME_AUTH_DHCHAP_MESSAGE_CHALLENGE:
> -		status = nvmet_auth_challenge(req, d, al);
> -		if (status < 0) {
> +		int ret = nvmet_auth_challenge(req, d, al);
> +
> +		if (ret < 0) {
>   			pr_warn("ctrl %d qid %d: challenge error (%d)\n",
>   				ctrl->cntlid, req->sq->qid, status);
>   			status = NVME_SC_INTERNAL;

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] nvmet: fix return value check in auth send
  2022-07-18 23:12 ` [PATCH 1/2] nvmet: fix return value check in auth send Chaitanya Kulkarni
  2022-07-19  6:51   ` Hannes Reinecke
@ 2022-07-21  5:41   ` Christoph Hellwig
  1 sibling, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-07-21  5:41 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: hare, linux-nvme, hch, sagi, Dan Carpenter

Thanks, both patches applied to nvme-5.20.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth
  2022-07-18 23:12 [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth Chaitanya Kulkarni
  2022-07-18 23:12 ` [PATCH 1/2] nvmet: fix return value check in auth send Chaitanya Kulkarni
  2022-07-18 23:12 ` [PATCH 2/2] nvmet: fix return value check in auth receive Chaitanya Kulkarni
@ 2022-07-21 22:15 ` Sagi Grimberg
  2 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2022-07-21 22:15 UTC (permalink / raw)
  To: Chaitanya Kulkarni, hare; +Cc: linux-nvme, hch

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-21 22:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 23:12 [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth Chaitanya Kulkarni
2022-07-18 23:12 ` [PATCH 1/2] nvmet: fix return value check in auth send Chaitanya Kulkarni
2022-07-19  6:51   ` Hannes Reinecke
2022-07-21  5:41   ` Christoph Hellwig
2022-07-18 23:12 ` [PATCH 2/2] nvmet: fix return value check in auth receive Chaitanya Kulkarni
2022-07-19  6:51   ` Hannes Reinecke
2022-07-21 22:15 ` [PATCH 0/2] nvmet: type missmatch fixes for nvmet-auth Sagi Grimberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.