public inbox for asahi@lists.linux.dev
 help / color / mirror / Atom feed
From: Sven Peter <sven@kernel.org>
To: Jens Reidel <adrian@mainlining.org>, Janne Grunau <j@jannau.net>,
	Neal Gompa <neal@gompa.dev>,
	Srinivas Kandagatla <srini@kernel.org>,
	Sasha Finkelstein <fnkl.kernel@gmail.com>,
	Hector Martin <marcan@marcan.st>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Clayton Craft <craftyguy@postmarketos.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] nvmem: apple-spmi-nvmem: wrap regmap calls to satisfy CFI
Date: Sun, 23 Nov 2025 22:46:06 +0100	[thread overview]
Message-ID: <9d0aa1ef-a356-4ce0-8ea4-321d07c25ad2@kernel.org> (raw)
In-Reply-To: <20251118-apple-spmi-nvmem-cfi-v1-1-75b9ced0a2c2@mainlining.org>

On 18.11.25 03:35, Jens Reidel wrote:
> The Apple SPMI NVMEM driver previously cast regmap_bulk_read/write to
> void * when assigning them to nvmem_config's reg_read/reg_write
> function pointers.
> 
> This cast breaks the expected function signature of nvmem_reg_read_t
> and nvmem_reg_write_t. With CFI enabled, indirect calls through
> these pointers fail:
> 
>    CFI failure at nvmem_reg_write+0x194/0x1e4 (target: regmap_bulk_write+0x0/0x2c8; expected type: 0x83a189c3)
>    ...
>    Call trace:
>     nvmem_reg_write+0x194/0x1e4 (P)
>     __nvmem_cell_entry_write+0x298/0x2e8
>     nvmem_cell_write+0x24/0x34
>     macsmc_reboot_probe+0x1dc/0x454 [macsmc_reboot]
>    ...
> 
> Introduce thin wrapper functions with the correct nvmem function
> pointer types to satisfy the CFI checks.
> 
> Fixes: fe91c24a551c ("nvmem: Add apple-spmi-nvmem driver")
> Signed-off-by: Jens Reidel <adrian@mainlining.org>
> Reported-by: Clayton Craft <craftyguy@postmarketos.org>
> Tested-by: Clayton Craft <craftyguy@postmarketos.org>
> Cc: stable@vger.kernel.org
> ---

Reviewed-by: Sven Peter <sven@kernel.org>


Thanks,


Sven


      reply	other threads:[~2025-11-23 21:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18  2:35 [PATCH] nvmem: apple-spmi-nvmem: wrap regmap calls to satisfy CFI Jens Reidel
2025-11-23 21:46 ` Sven Peter [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=9d0aa1ef-a356-4ce0-8ea4-321d07c25ad2@kernel.org \
    --to=sven@kernel.org \
    --cc=adrian@mainlining.org \
    --cc=asahi@lists.linux.dev \
    --cc=craftyguy@postmarketos.org \
    --cc=fnkl.kernel@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=j@jannau.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=neal@gompa.dev \
    --cc=srini@kernel.org \
    --cc=stable@vger.kernel.org \
    /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