From: Nathan Chancellor <nathan@kernel.org>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
Alexander Usyskin <alexander.usyskin@intel.com>,
Anshuman Gupta <anshuman.gupta@intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
intel-xe@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mei: late_bind: Fix -Wincompatible-function-pointer-types-strict
Date: Thu, 23 Oct 2025 18:52:05 +0200 [thread overview]
Message-ID: <20251023165205.GD2090923@ax162> (raw)
In-Reply-To: <qxvmx7nawbqjj5luzzken3psdei7pvgliieiv4vdxgumb2wpkx@p4ckdsds66ak>
On Thu, Oct 23, 2025 at 09:27:03AM -0500, Lucas De Marchi wrote:
> On Sat, Sep 20, 2025 at 04:17:50PM -0700, Nathan Chancellor wrote:
> > When building with -Wincompatible-function-pointer-types-strict, a
> > warning designed to catch kernel control flow integrity (kCFI) issues at
> > build time, there is an instance in the new mei late binding code
> > originating from the type parameter of mei_lb_push_payload():
> >
> > drivers/misc/mei/mei_lb.c:211:18: error: incompatible function pointer types initializing 'int (*)(struct device *, u32, u32, const void *, size_t)' (aka 'int (*)(struct device *, unsigned int, unsigned int, const void *, unsigned long)') with an expression of type 'int (struct device *, enum intel_lb_type, u32, const void *, size_t)' (aka 'int (struct device *, enum intel_lb_type, unsigned int, const void *, unsigned long)') [-Werror,-Wincompatible-function-pointer-types-strict]
> > 211 | .push_payload = mei_lb_push_payload,
> > | ^~~~~~~~~~~~~~~~~~~
> >
> > While 'unsigned int' and 'enum intel_lb_type' are ABI compatible, hence
> > no regular warning from -Wincompatible-function-pointer-types, the
> > mismatch will trigger a kCFI violation when mei_lb_push_payload() is
> > called indirectly.
> >
> > Update the type parameter of mei_lb_push_payload() to be 'u32' to match
> > the prototype in 'struct intel_lb_component_ops', clearing up the
> > warning and kCFI violation.
> >
> > Fixes: 741eeabb7c78 ("mei: late_bind: add late binding component driver")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>
> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Sasha, is this fix something you are taking through char-misc since the
> commits that added it already propagated through the 6.18-rc?
It looks like Greg already took this via char-misc-linus:
https://git.kernel.org/gregkh/char-misc/c/98718e80af0bb1cd80f4bfe565dd60c57debad51
Cheers,
Nathan
next prev parent reply other threads:[~2025-10-23 16:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-20 23:17 Nathan Chancellor
2025-10-23 14:27 ` Lucas De Marchi
2025-10-23 16:52 ` Nathan Chancellor [this message]
2025-10-23 16:59 ` Lucas De Marchi
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=20251023165205.GD2090923@ax162 \
--to=nathan@kernel.org \
--cc=alexander.usyskin@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rodrigo.vivi@intel.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
all inboxes | Powered by JetHome®