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=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,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 17288C432BE for ; Thu, 2 Sep 2021 13:29:50 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91A0061058 for ; Thu, 2 Sep 2021 13:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 91A0061058 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A366083461; Thu, 2 Sep 2021 15:29:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Ue7FUkEJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 05FC183494; Thu, 2 Sep 2021 15:29:12 +0200 (CEST) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C3CC48348A for ; Thu, 2 Sep 2021 15:29:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x829.google.com with SMTP id l24so1490432qtj.4 for ; Thu, 02 Sep 2021 06:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=c7rhuKyzKiStd6DjAvd5R3OO+T5D+oFQkJ3BK73B0V4=; b=Ue7FUkEJD3aFZVUhKrFmD4iX8IITjEP7gPq499uvpIiVZTT4T79JKTPlv0Z+BQGjM+ WGVF2dGxnGTde7Yodw5VLsUkx5JgB/s5MVcVwq+AXNZFuD1fU/G0I6HgV9/SQ6ZTdbNM ydsfAkG7KhtDoL1IxpIirHozdmUg4Vi0Tlmeo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=c7rhuKyzKiStd6DjAvd5R3OO+T5D+oFQkJ3BK73B0V4=; b=j99jyYSidTn2C+iwaO/FH7xkMXEPm0tiCGQZGo+Mc+JI51hDz1nwOgIQSGY6cr6aZ+ 9EdQeeqvbmVp7LJeoXQqbFfqqKiJAwDmb8MgCahN+708KdqCfrPe0jI5R1YobvJttnit BVwfVL8n3pueW1zbL5YJxwEouQNBSk5+54jBhBK5oZm3X+2j3jpCkk/GhisNTQpcyNH3 +abtt0Sg9Rftaxin1SFW4lXg4mMIWcj4hxUbR4H7piznm+GaywPFqPjvIPBiIeRcu5Ep q3l1kn3/lZO+OZ6faG7wD8adCk/xiceDW/HYHsL00bPogU40WwzA9/YHNQMBTioi0Nxs 5YXg== X-Gm-Message-State: AOAM533PWFZMshnRLdGwHhN8nAalep3Jmn1d181WmQOL/S2lnVQHPKSN 8OvRUV4zqX1sQeJQiVo40y304g== X-Google-Smtp-Source: ABdhPJzD96CGZKtQokLM+5L/MX6kWRFNaEsig/gryzc71eWWT8XA31dhFPhba/JtOnHmSTlMaXXCww== X-Received: by 2002:ac8:7f51:: with SMTP id g17mr2964293qtk.16.1630589341485; Thu, 02 Sep 2021 06:29:01 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-95b1-4c42-35f4-d991.res6.spectrum.com. [2603:6081:7b01:cbda:95b1:4c42:35f4:d991]) by smtp.gmail.com with ESMTPSA id i67sm1417479qkd.90.2021.09.02.06.29.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Sep 2021 06:29:00 -0700 (PDT) Date: Thu, 2 Sep 2021 09:28:58 -0400 From: Tom Rini To: Thomas Hebb Cc: u-boot@lists.denx.de, Alexandru Gagniuc , Joel Stanley , Naoki Hayama , Simon Glass , Yann Dirson Subject: Re: [PATCH] mkimage: clarify error message for empty input files Message-ID: <20210902132858.GC858@bill-the-cat> References: <7c0f1ff7f8f77dd94cd74e7907b488d3a0a1e492.1627856591.git.tommyhebb@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bu3k8fPJKBQh9ZLt" Content-Disposition: inline In-Reply-To: <7c0f1ff7f8f77dd94cd74e7907b488d3a0a1e492.1627856591.git.tommyhebb@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --bu3k8fPJKBQh9ZLt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 01, 2021 at 03:23:13PM -0700, Thomas Hebb wrote: > Currently, an empty imput file causes `mmap()` to fail, and you get an > error like "mkimage: Can't read file.img: Invalid argument", which is > extremely unintuitive and hard to diagnose if you don't know what to > look for. Add an explicit check for an empty file and provide a clear > error message instead. >=20 > We already bounds check the image size when listing and re-signing > existing images, so we only need this check here, when opening data > files going into a image. >=20 > Signed-off-by: Thomas Hebb > Reviewed-by: Simon Glass Applied to u-boot/next, thanks! --=20 Tom --bu3k8fPJKBQh9ZLt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEw0ZoACgkQFHw5/5Y0 tywkRwwAtdyB8/NBg6johMAxMLDW8U4uQm+2FJ6RJem6DjSNGMYy8T1RK98UHELe qUkB3mUvfb7NhlWFXDcSTirrW00uCAcmLCn1a7r+g3T/yEoFQ3Bi2FtuMaDK6tdg cwjRcWy1wh4P5DDMPwIkCWVoumnNsOobDUzqNASRiB0bqs2L2xHQ+8gpLqKkl3L9 6zcK3vqRwNVc4ea3GR7SyUMSTdOpwI60y3LXSlug6AvwNBuZ5aB7Ewmgs42Oxfcv K2UZ7KetEbRICavZsjIewbyTJDF9roITUb9NKmOMdAX0Yw2LTCkYCNbPZNDcUkl9 Tcsj+4HXYCoZCRQ0b1uJivHMDc9fR/TpmCvD/ONnd1477BkT+6E/LYtfrjARJ95g fjgbtxEnCJUZcFIZkOaVwSKNHbP9NAEd81nfyN5me8nHZ/6v65SQtgHVf4flSpGD YJuT8+PYdR0eCCZLpA8YQiROMHH6j+wQoto4Nv6Yp3WtLZUMFtvuU2RgS9Yzscs0 fMeWVx7q =ycUu -----END PGP SIGNATURE----- --bu3k8fPJKBQh9ZLt--