From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hTieh-0001el-U6 for barebox@lists.infradead.org; Thu, 23 May 2019 08:00:53 +0000 Date: Thu, 23 May 2019 10:00:50 +0200 From: Sascha Hauer Message-ID: <20190523080050.voxwf3rw4apjl7t5@pengutronix.de> References: <20190523065712.isc4cdwsnbqvmtf7@pengutronix.de> <1558597740-86748-1-git-send-email-j.remmet@phytec.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1558597740-86748-1-git-send-email-j.remmet@phytec.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH v2] common: state: check length To: Jan Remmet Cc: barebox@lists.infradead.org On Thu, May 23, 2019 at 09:49:00AM +0200, Jan Remmet wrote: > if written_length is read from a partial written bucket it may be to > big and xmalloc will panic barebox. > > Check if the value is sane. Make read_len unsigned to avoid negative > values. > > Signed-off-by: Jan Remmet > --- > v2: replace compare < 0 by making read_len unsigned Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox