Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sreeraj S Kurup" <sreekuttan2156239@gmail.com>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvmet: use appropriate types for authentication payload lengths
Date: Sat, 31 Oct 2026 08:09:17 +0000	[thread overview]
Message-ID: <sashiko-outbox-191817@kernel.org> (raw)
In-Reply-To: <20261031075932.4345-1-sreekuttan2156239@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] nvmet: format specifier mismatch in nvmet_auth_challenge()
--

commit 53d4c9b2a209bbb82f1d82e67292975434b27d23
Author: Sreeraj S Kurup <sreekuttan2156239@gmail.com>

nvmet: use appropriate types for authentication payload lengths

This commit changes the payload length parameter al in nvmet_auth_challenge()
and nvmet_auth_success1() from int to u32, and changes data_size in
nvmet_auth_challenge() from int to size_t.

> diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
> index 70136f6c22e8c..99caad6fb87fb 100644
> --- a/drivers/nvme/target/fabrics-cmd-auth.c
> +++ b/drivers/nvme/target/fabrics-cmd-auth.c
> @@ -448,13 +448,13 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
>  	nvmet_req_complete(req, status);
>  }
>  
> -static int nvmet_auth_challenge(struct nvmet_req *req, void *d, int al)
> +static int nvmet_auth_challenge(struct nvmet_req *req, void *d, u32 al)
>  {
>  	struct nvmf_auth_dhchap_challenge_data *data = d;
>  	struct nvmet_ctrl *ctrl = req->sq->ctrl;
>  	int ret = 0;
>  	int hash_len = nvme_auth_hmac_hash_len(ctrl->shash_id);
> -	int data_size = sizeof(*data) + hash_len;
> +	size_t data_size = sizeof(*data) + hash_len;
>  
>  	if (ctrl->dh_tfm)
>  		data_size += ctrl->dh_keysize;

[Severity: Low]
Now that al is u32 and data_size is size_t in nvmet_auth_challenge(), does the
pr_debug() immediately below also need its format specifiers updated from %d
to %u and %zu to avoid a -Wformat warning on 64-bit builds?

	if (al < data_size) {
		pr_debug("%s: buffer too small (al %d need %d)\n", __func__,
			 al, data_size);
		return -EINVAL;
	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031075932.4345-1-sreekuttan2156239@gmail.com?part=1


  reply	other threads:[~2026-10-31  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  7:59 [PATCH] nvmet: use appropriate types for authentication payload lengths Sreeraj S Kurup
2026-10-31  8:09 ` sashiko-bot [this message]
2026-10-31  8:17 ` [PATCH v2] " Sreeraj S Kurup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-191817@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sreekuttan2156239@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox