From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796197065; b=j+bT4kdngycmd2qmHXQOMUVelpZ45kFWuOKsuW0fcs0fPgwwoE3cWNxxwkXdklWEbov9 o9L/4zYTIpiWpp/p+t5TvygpwhOYySJt2i2lEBgTnKg7qXZT5MFRaL1qpSu+SAX+K1k5B wdfKjBNRRNRhtb53db6Az9OezQdV90XwgYe/vu0uHqL5BsigU2viaSJbGPCrf/XoKBRSg lPpUQOUjArCtx9tH3h5nY9lAC+jRZXk2Ti4fZpRy+a3Oeewe6tD3WVNXtgFseGKUGfU9m d8gYAWm9NtJL/PLPaBrDJ9m6BJLjyLBsNBwT9nCiE7jrumW1wQQ6riNKcqejOa5/O6w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796197065; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=obY8xFRuMmVH20VRMYw9Yi2gEJZbFxOK/15I/80fA/k=; b=jYERRqf1bzuwqYmXc/Lf4c1bKgg9PjuiPeVCLT/ckh9xi1/CXu0e3L628eoK5MBshGOO USIQR9xZeBWKIJrZzHZ2JY0PqQIpnzZeLhrFkzzCHpTw/L4sOB1xay0ga0OqCbGEqhlX0 INGiOk7ukTaBXaoJUbvxR9tXl89N576WQbVqyMcB+2akpe/7UqnsEtYY4p+dlBV/0gGw6 pYoC8rJq4pUflY9pYrIgviss/U0O+hBD/BFQIIoBCoCrXf1j5+76HFGQdvymPX422DmP4 jQD6f2Nut2bhiqNGubnItexX5YLQGjrnYhG0RK7Ee8LeDXQ9ghhIjotCp7gauEAbJ3A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VU2zpH0j; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 669D0606A31A for ; Wed, 2 Dec 2026 07:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VU2zpH0j Received: by smtp.kernel.org (Postfix) with ESMTPSA id 614391F000C1; Wed, 2 Dec 2026 07:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796197064; bh=obY8xFRuMmVH20VRMYw9Yi2gEJZbFxOK/15I/80fA/k=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=VU2zpH0je9Kblxh4SQSvtEm4r9krysys6OBIAQGqyEgG9xjLEbLpCLfHvgGq7zF+6 0ruXueoWXnRDKJ5f6vlk5Z+NKKlsWVRC4dWSIuyQfCBXmwv7uwIndBvvOl+qh4iLw7 iZfPhlLeC+a+JNVPkFq9pmK+gnX9CWK5RIVq1Xhk= Date: Wed, 2 Dec 2026 08:37:42 +0100 From: Greg Kroah-Hartman To: Rosen Penev Cc: Srinivas Kandagatla , linux-kernel@vger.kernel.org, egc112@msn.com Subject: Re: [PATCH v2] nvmem: brcm_nvram: don't cut NVRAM data shorter than its header length Message-ID: <2026120217-jumble-deluge-0ea0@gregkh> References: <20261129215551.20747-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Dec 01, 2026 at 08:09:43PM -0800, Rosen Penev wrote: > On Tue, Dec 1, 2026 at 5:55 AM Srinivas Kandagatla wrote: > > > > > > > > On 11/29/26 9:55 PM, Rosen Penev wrote: > > > brcm_nvram_copy_data() sizes the data by stripping trailing bytes that > > > equal the last byte of the region. NVRAM content itself ends with NUL > > > bytes, so when the region is padded with 0x00 instead of erased 0xff, > > > the loop also strips the end of the content. Since > > > commit a67e2c323a47 ("nvmem: brcm_nvram: fix out-of-bounds access on malformed flash data") > > > the header length is checked against that size, and such NVRAM is now > > > rejected. On an ASUS RT-N16, whose CFE pads NVRAM with zeros: > > > > > > brcm_nvram 1dff8000.nvram: NVRAM length (2600) exceeds data size (2596) > > > > > > Extend the data to the length in the header when that fits in the > > > mapped region. The buffer still covers every byte the parser reads, > > > so the out-of-bounds protection is kept. > > > > > > Fixes: a67e2c323a47 ("nvmem: brcm_nvram: fix out-of-bounds access on malformed flash data") > > > > CC Stable missing. > Is that seriously it? The bots will backport it anyway. Maybe, maybe not. You are taking a chance we will not do it unless cc: stable is really there.