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=1796205499; b=QuQK3LvliJ6A44ppEe8TCfL/R7VyJC6pCobQKlzNSYpZ2IhHwta8nvKn59TD5BVKXINx hzY12fz2fE32QXhc6l4ISkyyexPV+2q8pGIKYBd6ERrgHx/LhATWYc0CYJR/armn9AsTH juisGo1WpJD/g3ALb7FS2k5fxOmR7BNtuEgLr+E3UeQ/NHNF09ebCeljt/3srWaAe9Sv5 r2E3g68Xitrf9Nyx26D3lWs78q8CebDN5hBoA1NIoO/YatwMx/cAcrMm6bvxadAjQfMPR Fq1C8t618CWqBN9C72HLfMot/ZxNKPoK/Z2SDNm3CjoV8LB1IubA9ek1Q4N87xt7Kbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796205499; 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=zPJZbZ7zVd4b8owIZy7+0FBO6wLliDa7zWr12+MpDkw=; b=Jt6U3H8kxOdvbVggyws1crr2bg4uDAxyUT4UlrU4F8w4GChEr5E90AjfosMnW3FcmfQN WjaYc+8jHaVbeWhtqCNQMKUd0zLk9QMuWy5IZ+bSJzloUn4g4+0Zl3E0GtkApk2cVroET a9+ha6ep5jGdHPNmfexk/0PZISnPDDev/Yf+39NaRJIR5JWh4DvQnwexQ44h96p42OVgr bZdBlnXZ/u+XmHqRYTe9YMdzSiOHqlmj2iMIW8q1odyOzGukeP6UIf99qo5brE1CAPwoW OBh5E0txHmXFAUsvpgFDUcBzvpgGil4fLU1kwbr1XpXCrabq2IdOJXrhplxMJHtb4LQ== 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=ZJvWdMoW; 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 2EA79606A339 for ; Wed, 2 Dec 2026 09:58:19 +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=ZJvWdMoW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E0151F00932; Wed, 2 Dec 2026 09:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796205498; bh=zPJZbZ7zVd4b8owIZy7+0FBO6wLliDa7zWr12+MpDkw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ZJvWdMoW6UX2ktDADHUJsVT/2Ym/3rbBNdVzqsH+t/gqBClq7h1gPY6GuwKVR9tfa XxXVtu0PySk5GLFL+dlxdfSoA7RrINf3nw/yQlY5iLRYqcPU7I5crd/GgmkbCtK/ML QXhn4wvJb4PuZ48i4aRE4PXn2sJmYH+xlHltmRyE= Date: Wed, 2 Dec 2026 10:58:16 +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: <2026120244-cobalt-violet-de41@gregkh> References: <20261129215551.20747-1-rosenp@gmail.com> <2026120217-jumble-deluge-0ea0@gregkh> 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 Wed, Dec 02, 2026 at 01:52:34AM -0800, Rosen Penev wrote: > On Tue, Dec 1, 2026 at 11:37 PM Greg Kroah-Hartman > wrote: > > > > 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. > I think all my commits with Fixes: tags have been backported. Even > some without. I'll resend just in case. You got lucky, AND you did not get any notification if things failed to apply properly. That's why the documentation says you HAVE to put a cc: stable if you want it backported. thanks, greg k-h