From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB8D83C140D for ; Mon, 27 Apr 2026 13:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777295345; cv=none; b=fCEPKwdLB05s3RaL/uK3kgVzU7jLYLij2yxFlZND6ifgrUsPkrXcwqNyi0XDj/obiZPqLup29xyKtVknYxsDjtDjUYwXtDzXrZc7lXfIEfKtrcjBU+gfAGi6FCpjFS8UwDYTALP+tTA6WjK7KCmUK95+9snqhToAStwxS7QFTO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777295345; c=relaxed/simple; bh=VBWt0kaQnFT4JHolqg/vgM57aj7M7jjkSXwVvcQWg4w=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=hwdKWPYwLxoUaIGBWtUp1lE+6dH/Uo5ZX9lsJybYh6HnYr6/Od5njlFAg3jz57H0+Wi4qHMaL36KcOMDt7r5vDBnJXM5ifhDUXqi8/ZDQFYMw0L7I17YpbcfJU5D+RcIuRntLbH5rvo8CneV8pNrvDi/2C8oAJR0KR/2+9Ty7/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=JB5ppoGw; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="JB5ppoGw" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 097EF1A3443; Mon, 27 Apr 2026 13:08:59 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CBC16600D1; Mon, 27 Apr 2026 13:08:58 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5EE9510728039; Mon, 27 Apr 2026 15:08:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777295337; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=O8yxX0gO7nTEAcY/1Dd9O+rvwBL+vwhqZY4uok46s0Y=; b=JB5ppoGws1cWp+TPLhjXB5zGL54fxXQKVnuBVJ+xwaYL/LTsh9W86NI79+k3pKTL4+0rDU D+evLg+uwrklJarNRyhcQ6zlBErM75BWT4B7J8eduTjGV1cTBwvRlUMoD/eaclWTh0Td5J k+OWhNWUqrRAmwL0wht1io4Ayzu87O+26Jd4fY+orcP8PxdCoXyXTjO6wC+zKaSLIEmG+6 ZYXZfa5YD8JQdhlxZqFJkQWyrWfXQA2aoNJwEXf9qc/9ONswo3SHB56r848y6uFKLLQ5qY wcYTNjiiFgzXXyg9ZZ1RvDRIgFPSxoHN8isdX/FOOYy7S++7UNxoD/9FhyICOg== From: Miquel Raynal To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus Cc: Pratyush Yadav , Michael Walle , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org In-Reply-To: <20260417-fix-oob-read-spi-nor-v1-1-2132e61a684a@linaro.org> References: <20260417-fix-oob-read-spi-nor-v1-1-2132e61a684a@linaro.org> Subject: Re: [PATCH] mtd: spi-nor: debugfs: fix out-of-bounds read in spi_nor_params_show() Message-Id: <177729533643.179808.1459860787473321982.b4-ty@bootlin.com> Date: Mon, 27 Apr 2026 15:08:56 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 On Fri, 17 Apr 2026 15:24:39 +0000, Tudor Ambarus wrote: > Sashiko noticed an out-of-bounds read [1]. > > In spi_nor_params_show(), the snor_f_names array is passed to > spi_nor_print_flags() using sizeof(snor_f_names). > > Since snor_f_names is an array of pointers, sizeof() returns the total > number of bytes occupied by the pointers > (element_count * sizeof(void *)) > rather than the element count itself. On 64-bit systems, this makes the > passed length 8x larger than intended. > > [...] Applied to mtd/fixes, thanks! [1/1] mtd: spi-nor: debugfs: fix out-of-bounds read in spi_nor_params_show() commit: e47029b977e747cb3a9174308fd55762cce70147 Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then). Kind regards, Miquèl