From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Lee Jones <lee@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Chunyan Zhang <zhang.lyra@gmail.com>,
Freeman Liu <freeman.liu@unisoc.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Orson Zhai <orsonzhai@gmail.com>,
Srinivas Kandagatla <srini@kernel.org>
Subject: Re: [PATCH 03/10] nvmem: sprd: Avoid out-of-bounds read on partial writes in sprd_efuse_raw_prog()
Date: Fri, 4 Dec 2026 09:27:05 +0800 [thread overview]
Message-ID: <7feb7dfb-16ea-4e86-8d57-a2e8c5a19e9d@linux.alibaba.com> (raw)
In-Reply-To: <ad902fb6d65b617d55dd5819275b60e05be82ee9.1796286324.git.lee@kernel.org>
On 12/3/26 4:26 PM, Lee Jones wrote:
> sprd_efuse_write() allows partial-block writes smaller than
> SPRD_EFUSE_BLOCK_WIDTH (4 bytes) because the device registers with
> word_size and stride set to 1. Passing val directly to
> sprd_efuse_raw_prog() as u32 * and dereferencing *data performs a 4-byte
> out-of-bounds heap read past short buffers and burns slab contents into
> hardware eFuses, while writes larger than 4 bytes are silently
> truncated.
>
> Validate that bytes is in [1, SPRD_EFUSE_BLOCK_WIDTH], copy bytes into a
> zero-initialised __le32 local variable, and pass the converted u32 value
> to sprd_efuse_raw_prog() by value.
>
> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> Closes: https://sashiko.dev/#/bug/linux-7e0bb49f-4129-4a8d-a023-a0dbab6773f6
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
Thanks. LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
next prev parent reply other threads:[~2026-12-04 1:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 8:26 [PATCH 00/10] nvmem: Fix Critical and High issues reported by Sashiko Lee Jones
2026-12-03 8:26 ` Lee Jones
2026-12-03 8:26 ` [PATCH 01/10] nvmem: meson-efuse: Reject negative or zero SMC size in meson_efuse_probe() Lee Jones
2026-12-03 8:26 ` Lee Jones
2026-12-03 8:26 ` [PATCH 02/10] nvmem: core: Prevent integer underflow in nvmem_cell_attr_read() Lee Jones
2026-12-03 8:26 ` [PATCH 03/10] nvmem: sprd: Avoid out-of-bounds read on partial writes in sprd_efuse_raw_prog() Lee Jones
2026-12-04 1:27 ` Baolin Wang [this message]
2026-12-03 8:26 ` [PATCH 04/10] nvmem: core: Handle multi-byte bit offsets in nvmem_cell_prepare_write_buffer() Lee Jones
2026-12-03 8:26 ` [PATCH 05/10] nvmem: core: Serialise writes when toggling the write-protect GPIO Lee Jones
2026-12-03 8:26 ` [PATCH 06/10] nvmem: eeprom_93xx46: Reject unaligned writes on 16-bit devices Lee Jones
2026-12-03 8:26 ` [PATCH 07/10] nvmem: eeprom_93xx46: Hold device lock across erase/write enable sequences Lee Jones
2026-12-03 8:26 ` [PATCH 08/10] nvmem: eeprom_93xx46: Use DMA-safe command buffer for SPI transfers Lee Jones
2026-12-03 8:26 ` [PATCH 09/10] nvmem: meson-efuse: Detect short reads and writes from Secure Monitor Lee Jones
2026-12-03 8:26 ` Lee Jones
2026-12-03 8:54 ` sashiko-bot
2026-12-03 8:26 ` [PATCH 10/10] nvmem: stm32: Avoid OP-TEE session leak on unaligned writes Lee Jones
2026-12-03 10:16 ` Patrick DELAUNAY
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=7feb7dfb-16ea-4e86-8d57-a2e8c5a19e9d@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=freeman.liu@unisoc.com \
--cc=gregkh@linuxfoundation.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=orsonzhai@gmail.com \
--cc=srini@kernel.org \
--cc=stable@vger.kernel.org \
--cc=zhang.lyra@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.