public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pierre AUBERT <p.aubert@staubli.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] PATCH: bug fix in IDE identification strings
Date: Tue, 16 Mar 2004 08:58:46 +0100	[thread overview]
Message-ID: <4056B3B6.70808@staubli.com> (raw)
In-Reply-To: <1079372756.3116.12.camel@tt-devel.ultra.si>


Hi,
Leon KUKOVEC wrote:

>Hi Wolfgang,
>
>On Mon, 2004-03-15 at 14:32, Wolfgang Denk wrote:
>  
>
>>In message <4055AA27.3010805@staubli.com> you wrote:
>>    
>>
>>>The attached patch fixes a bug in the ide identification string copy.
>>>      
>>>
>>I may be missing something - but why do we copy these strings in  the
>>first place? Who is using them? (and where?)
>>    
>>
>
>The block_dev_desc_t structure defines vendor[40], product[20] and
>revision[8] - same as it is defined in hd_driveid_t.
>
>ident_cpy's description says that it will copy the string and
>terminate it, but it can't in the case where all 8 bytes of revision
>are occupied - since the buffers are equal size.
>  
>
My hard disk has a 8 bytes revision string. In this case, u-boot crashes 
in init_part
because the block_read field of the block_dev_desc_t structure has been 
partially erased
by the ending null of the revision string. This crash didn't occured 
with the revison 1.5 of include/part.h
because the field removable was beetween fields revision and block_read.

>Therefore Pierre's patch is correct, but instead of hardcoded values
>8, 40, 20 I would rather see sizeof (iop->fw_rev) etc.
>  
>
The attached patch replaces my previous with this modification.

>I noticed the same thing today when I was testing the PCMCIA
>patch that I'm about to send for PXA.
>
>  
>
Best regards
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: u-boot-ide-ident.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20040316/c9201d4a/attachment.txt 

  reply	other threads:[~2004-03-16  7:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 13:05 [U-Boot-Users] PATCH: bug fix in IDE identification strings Pierre AUBERT
2004-03-15 13:32 ` Wolfgang Denk
2004-03-15 13:59   ` Pierre AUBERT
2004-03-15 17:45   ` Leon KUKOVEC
2004-03-16  7:58     ` Pierre AUBERT [this message]
2004-03-17  1:19     ` Wolfgang Denk
2004-03-18 16:30     ` Pierre AUBERT
2004-03-23 23:05       ` Wolfgang Denk
2004-03-17  1:13 ` Wolfgang Denk

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=4056B3B6.70808@staubli.com \
    --to=p.aubert@staubli.com \
    --cc=u-boot@lists.denx.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