mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org, Rashidwi <rashidwinter@gmail.com>
Subject: Re: [PATCH] uimage: fix CRC32 verification on NFS
Date: Mon, 14 Oct 2024 17:00:02 +0200	[thread overview]
Message-ID: <df25b302-805f-48df-8a9a-eb601e127e18@pengutronix.de> (raw)
In-Reply-To: <Zw0wHH440fOO9BLm@pengutronix.de>

On 14.10.24 16:52, Sascha Hauer wrote:
> On Mon, Oct 14, 2024 at 03:18:18PM +0200, Ahmad Fatoum wrote:
>> On 14.10.24 15:10, Sascha Hauer wrote:
>>> On Wed, Oct 02, 2024 at 06:07:15PM +0200, Ahmad Fatoum wrote:
>>>> diff --git a/common/uimage.c b/common/uimage.c
>>>> index 140a08c1e426..c578edae2606 100644
>>>> --- a/common/uimage.c
>>>> +++ b/common/uimage.c
>>>> @@ -272,7 +272,9 @@ int uimage_verify(struct uimage_handle *handle)
>>>>  		ret = read(handle->fd, buf, now);
>>>>  		if (ret < 0)
>>>>  			goto err;
>>>> -		crc = crc32(crc, buf, now);
>>>> +		if (!ret)
>>>> +			break;
>>>
>>> Should we have an extra error message in this case? The information that
>>> a uImage is shorter than expected might be valuable for the user.
>>
>> I don't see the need to differentiate between premature end and corrupted
>> bytes. Both are problems in another layer anyway and people still stuck
>> using uImage may not like losing extra bytes for an error message anyway.
> 
> I could imagine that knowing that the image is too short would put me on
> another path when searching for the issue.
> 
> Anyway, debugging this shouldn't be too hard, even without this
> information.

Agreed.

Cheers,
Ahmad

> 
> Sascha
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2024-10-14 15:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 16:07 Ahmad Fatoum
2024-10-14 13:10 ` Sascha Hauer
2024-10-14 13:18   ` Ahmad Fatoum
2024-10-14 14:52     ` Sascha Hauer
2024-10-14 15:00       ` Ahmad Fatoum [this message]
2024-10-15  8:17 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df25b302-805f-48df-8a9a-eb601e127e18@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=rashidwinter@gmail.com \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox