From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD98BC2D0C9 for ; Sat, 14 Dec 2019 08:38:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83A8724658 for ; Sat, 14 Dec 2019 08:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726121AbfLNIh6 (ORCPT ); Sat, 14 Dec 2019 03:37:58 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:36612 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfLNIh6 (ORCPT ); Sat, 14 Dec 2019 03:37:58 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id C1ABB1C25E0; Sat, 14 Dec 2019 09:37:55 +0100 (CET) Date: Sat, 14 Dec 2019 09:37:55 +0100 From: Pavel Machek To: Ben Hutchings Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org, Denis Kirjanov , Jacek Anaszewski , Nick Stoughton Subject: Re: [PATCH 3.16 04/72] leds: leds-lp5562 allow firmware files up to the maximum length Message-ID: <20191214083755.GA16834@duo.ucw.cz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun 2019-12-08 13:52:48, Ben Hutchings wrote: > 3.16.79-rc1 review patch. If anyone has any objections, please let > me know. Nobody is hitting this one and noone cares. Not a serious bug as described in stable rules. I'd recommend dropping. Pavel > ------------------ >=20 > From: Nick Stoughton >=20 > commit ed2abfebb041473092b41527903f93390d38afa7 upstream. >=20 > Firmware files are in ASCII, using 2 hex characters per byte. The > maximum length of a firmware string is therefore >=20 > 16 (commands) * 2 (bytes per command) * 2 (characters per byte) =3D 64 >=20 > Fixes: ff45262a85db ("leds: add new LP5562 LED driver") > Signed-off-by: Nick Stoughton > Acked-by: Pavel Machek > Signed-off-by: Jacek Anaszewski > Signed-off-by: Ben Hutchings > --- > drivers/leds/leds-lp5562.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > --- a/drivers/leds/leds-lp5562.c > +++ b/drivers/leds/leds-lp5562.c > @@ -263,7 +263,11 @@ static void lp5562_firmware_loaded(struc > { > const struct firmware *fw =3D chip->fw; > =20 > - if (fw->size > LP5562_PROGRAM_LENGTH) { > + /* > + * the firmware is encoded in ascii hex character, with 2 chars > + * per byte > + */ > + if (fw->size > (LP5562_PROGRAM_LENGTH * 2)) { > dev_err(&chip->cl->dev, "firmware data size overflow: %zu\n", > fw->size); > return; --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXfSfYwAKCRAw5/Bqldv6 8hizAJ9KPMstp0cBLL9HIBSGhx4A9Ek5awCgnSJATUmT2r9uSnXyTU/jYrooc7g= =v+lj -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G--