public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>,
	Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>, Bart Van Assche <bvanassche@acm.org>,
	Azeem Shaikh <azeemshaikh38@gmail.com>,
	Krishna Gudipati <kgudipat@brocade.com>,
	James Bottomley <JBottomley@parallels.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH 1/2] scsi: bfa: fix function pointer type mismatch for hcb_qe->cbfn
Date: Wed, 21 Jun 2023 11:33:29 -0700	[thread overview]
Message-ID: <202306211133.DD89F45965@keescook> (raw)
In-Reply-To: <20230616092233.3229414-1-arnd@kernel.org>

On Fri, Jun 16, 2023 at 11:22:09AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Some callback functions used here take a boolean argument, others
> take a status argument. This breaks KCFI type checking, so clang
> now warns about the function pointer cast:
> 
> drivers/scsi/bfa/bfad_bsg.c:2138:29: error: cast from 'void (*)(void *, enum bfa_status)' to 'bfa_cb_cbfn_t' (aka 'void (*)(void *, enum bfa_boolean)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
> 
> Assuming the code is actually correct here and the callers always match
> the argument types of the callee, rework this to replace the explicit
> cast with a union of the two pointer types. This does not change the
> behavior of the code, so if something is actually broken here, a larger
> rework may be necessary.
> 
> Fixes: 37ea0558b87ab ("[SCSI] bfa: Added support to collect and reset fcport stats")
> Fixes: 3ec4f2c8bff25 ("[SCSI] bfa: Added support to configure QOS and collect stats.")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

      parent reply	other threads:[~2023-06-21 18:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16  9:22 [PATCH 1/2] scsi: bfa: fix function pointer type mismatch for hcb_qe->cbfn Arnd Bergmann
2023-06-16  9:22 ` [PATCH 2/2] scsi: bfa: fix function pointer type mismatch for state machines Arnd Bergmann
2023-06-21 18:33   ` Kees Cook
2023-06-21 18:42     ` Arnd Bergmann
2023-06-21 18:33 ` Kees Cook [this message]

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=202306211133.DD89F45965@keescook \
    --to=keescook@chromium.org \
    --cc=JBottomley@parallels.com \
    --cc=anil.gurumurthy@qlogic.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=azeemshaikh38@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=kgudipat@brocade.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=martin.petersen@oracle.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=sudarsana.kalluru@qlogic.com \
    --cc=trix@redhat.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