From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.133 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796347637; b=TRvavUxbFA4S2sWomA3H/2xtodJTqRxnypSI8Ju+dHbkhQXELvxUd571OJEGUSO+60fI 8SwK6WcFQk9NO0aNdOmJyWNUKuiMMmZ+csftGNoIdsFrUS0V/DgTr7+URFnvv/F9pwgtW 1PKV1LJc2jySU+xq5mw7+y1fNdneUTwvIh21iRsDyeoRtaQHTcUSeM2QnPIC5BH5wd40I WvPukl3428BZTE4LF5UTABT72kCbNqXEEg8Dp3sx2o7XmjZMhv+HWQIAix28d9LpMnrxY BOigMr+HSJ3FxRMVwPgrIiso0xPm5bbtaBvImWWpfRasEwOZ1f5svrsDcSouZSCkPTg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796347637; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=oWGlb0a4kBqUhETe+k4NAxM5427B82Bww/fLtQcenqA=; b=W0knP6fBeXucE9pa7PNmDpch04AyIdlAak+8Va61Xmsi/Xq8WthAQC3u/8Hh/MScoA7s aEi12bQxCQL1EihgN1OVsleq/eYWEG9uEitnA4Ol963InOnXVVQuEL5cDB7GkGVfIsk61 /D4lZ5ZcJO+HybpoZ2zhnP5XM91OD/8EV88rqhZMDp3Dl0BEiIlAI3E2OLGuSPgxilvdJ iQ0d8zftd0NXw5jvl6Q0bUKQQqDtXtPtSIMUfA6DQrdD2zFbLP796wxxQyoYJfcQesIal tJjhgKpFiD5Jsqxf4G3FqmfnrusH4S6ZL5SFVO/60mCnvUs6t4wwcT4Beln7dX6rSIA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b="iz4Q/Teh"; arc=none smtp.remote-ip=115.124.30.133 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2FF3606A322; Fri, 4 Dec 2026 01:27:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2FF3606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=iz4Q/Teh DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796347627; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=oWGlb0a4kBqUhETe+k4NAxM5427B82Bww/fLtQcenqA=; b=iz4Q/TehIC5ylt43Jo7CTSiLxeJlvzNnlqoU4quCAHJE0r6xuv/0shFn9a/c10SdH3abXLOq+GI5MZtf3qgeubN0RLU/EkS3XolP7hz3puB+Yqk+UFGso1VL+De1rpsFMdvjHAu//uO6HNrUyluBtGXHEzkIF6ffa+T7ZbmnNyI= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037026112;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0XGFLmAn_1796347626; Received: from 30.74.144.139(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0XGFLmAn_1796347626 cluster:ay36) by smtp.aliyun-inc.com; Fri, 04 Dec 2026 09:27:06 +0800 Message-ID: <7feb7dfb-16ea-4e86-8d57-a2e8c5a19e9d@linux.alibaba.com> Date: Fri, 4 Dec 2026 09:27:05 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/10] nvmem: sprd: Avoid out-of-bounds read on partial writes in sprd_efuse_raw_prog() To: Lee Jones Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Chunyan Zhang , Freeman Liu , Greg Kroah-Hartman , Orson Zhai , Srinivas Kandagatla References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > --- Thanks. LGTM. Reviewed-by: Baolin Wang