Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dave Marquardt via B4 Relay"
	<devnull+davemarq.linux.ibm.com@kernel.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/5] ibmvfc: Add NOOP command support
Date: Thu, 13 Aug 2026 23:56:17 +0000	[thread overview]
Message-ID: <20260813235618.856231F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260408-ibmvfc-fpin-support-v1-2-52b06c464e03@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Missing empty list check in `ibmvfc_noop_test` causes a kernel panic if no VFC hardware is present.
- [Medium] The KUnit test spuriously fails if the physical adapter or VIOS does not support the NOOP capability.
- [Low] Passing `NULL` to `cpu_to_be64()` triggers an incompatible integer-to-pointer conversion warning.
--

--- Patch [2]: [PATCH 2/5] ibmvfc: Add NOOP command support ---
commit e47751d42fb9d0e5cf4c7d82f8f6ec6ab8f6405c
Author: Dave Marquardt <davemarq@linux.ibm.com>

ibmvfc: Add NOOP command support

This commit adds support for the VFC_NOOP command to the ibmvfc driver. It
updates the capabilities sent during login to include NOOP support and
handles NOOP CRQs. It also adds a KUnit test for the new command.

> diff --git a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c
> index 1c238896049f8..3359e4ebebe29 100644
> --- a/drivers/scsi/ibmvscsi/ibmvfc_kunit.c
> +++ b/drivers/scsi/ibmvscsi/ibmvfc_kunit.c

[ ... ]

> @@ -79,8 +79,35 @@ static void ibmvfc_handle_fpin_event_test(struct kunit *test)
>  	}
>  }
>  
> +/**
> + * ibmvfc_noop_test - unit test for VFC_NOOP command
> + * @test: pointer to kunit structure
> + *
> + * Return: void
> + */
> +static void ibmvfc_noop_test(struct kunit *test)
> +{
> +	struct ibmvfc_host *vhost;
> +	struct list_head *queue;
> +	struct ibmvfc_crq crq;
> +	struct list_head *headp;
> +	LIST_HEAD(evtq);
> +
> +	headp = ibmvfc_get_headp();
> +	queue = headp->next;
> +	vhost = container_of(queue, struct ibmvfc_host, queue);

[Severity: High]
Does this code dereference a wild pointer if no VFC hardware is present?

Unlike the previous test which safely aborts using
KUNIT_ASSERT_PTR_NE(test, queue, headp), it looks like this test accesses
headp->next unconditionally. If the list is empty, such as when running in
a CI environment without physical or virtual IBMVFC adapters, could calculating
the vhost pointer and subsequently dereferencing it crash the test runner?

> +
> +	KUNIT_EXPECT_TRUE(test, ibmvfc_check_caps(vhost, IBMVFC_SUPPORT_NOOP_CMD));

[Severity: Medium]
Will this test spuriously fail if the physical adapter or VIOS firmware is
older and does not support the NOOP capability? Should the test gracefully
skip instead of failing in environments without IBMVFC_SUPPORT_NOOP_CMD
support?

> +
> +	crq.valid = 0x80;
> +	crq.format = IBMVFC_VFC_NOOP;
> +	crq.ioba = cpu_to_be64(NULL);

[Severity: Low]
Does passing NULL to cpu_to_be64() trigger an incompatible integer-to-pointer
conversion warning? NULL is a pointer type, but the byte-swapping macro expects
a 64-bit integer, which might break the build if CONFIG_WERROR is enabled.

> +	ibmvfc_handle_crq(&crq, vhost, &evtq);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260408-ibmvfc-fpin-support-v1-0-52b06c464e03@linux.ibm.com?part=2

  parent reply	other threads:[~2026-08-13 23:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 17:07 [PATCH 0/5] ibmvfc: make ibmvfc support FPIN messages Dave Marquardt via B4 Relay
2026-04-08 17:07 ` [PATCH 1/5] ibmvfc: add basic FPIN support Dave Marquardt via B4 Relay
2026-05-07  4:12   ` Tyrel Datwyler
2026-05-07 22:22     ` Dave Marquardt
2026-04-08 17:07 ` [PATCH 2/5] ibmvfc: Add NOOP command support Dave Marquardt via B4 Relay
2026-05-07  4:17   ` Tyrel Datwyler
2026-05-07 22:25     ` Dave Marquardt
2026-08-13 23:56   ` sashiko-bot [this message]
2026-04-08 17:07 ` [PATCH 3/5] ibmvfc: make ibmvfc login to fabric Dave Marquardt via B4 Relay
2026-05-07  5:03   ` Tyrel Datwyler
2026-05-07 22:34     ` Dave Marquardt
2026-04-08 17:07 ` [PATCH 4/5] ibmvfc: use async sub-queue for FPIN messages Dave Marquardt via B4 Relay
2026-05-07  5:41   ` Tyrel Datwyler
2026-05-07 22:40     ` Dave Marquardt
2026-04-08 17:07 ` [PATCH 5/5] ibmvfc: handle extended FPIN events Dave Marquardt via B4 Relay
2026-05-07  5:48   ` Tyrel Datwyler
2026-05-08 14:38     ` Dave Marquardt
2026-04-30 16:25 ` [PATCH 0/5] ibmvfc: make ibmvfc support FPIN messages Martin K. Petersen
2026-05-07 22:15   ` Dave Marquardt

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=20260813235618.856231F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=devnull+davemarq.linux.ibm.com@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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